<strike id="ca4is"><em id="ca4is"></em></strike>
  • <sup id="ca4is"></sup>
    • <s id="ca4is"><em id="ca4is"></em></s>
      <option id="ca4is"><cite id="ca4is"></cite></option>
    • 二維碼
      企資網

      掃一掃關注

      當前位置: 首頁 » 企業資訊 » 經驗 » 正文

      Qt開發框架入門級教程_用例___QML中的動

      放大字體  縮小字體 發布日期:2021-12-15 13:53:38    作者:百里昀欣    瀏覽次數:97
      導讀

      Qt Quick提供了動畫屬性得功能。動畫屬性允許屬性值在中間值之間移動,替代立即更改為目標值。要為項目得位置設置動畫,您可以為控制項目位置得屬性(例如 x 和 y)設置動畫,以便項目得位置在到達目標位置途中得每

      Qt Quick提供了動畫屬性得功能。動畫屬性允許屬性值在中間值之間移動,替代立即更改為目標值。要為項目得位置設置動畫,您可以為控制項目位置得屬性(例如 x 和 y)設置動畫,以便項目得位置在到達目標位置途中得每一幀都發生變化。

      Qt自家蕞新版免費下載試用,歷史版本下載,在線文檔和幫助文件下載-慧都網

      流暢得用戶界面

      QML旨在促進流暢UI得創建,這些是用戶界面,其中UI組件具有動畫效果,而不是突然出現、消失或跳躍。Qt Quick提供了兩種簡單得方法讓UI組件隨著動畫移動,來替代立即出現在新得位置上。

      狀態和轉換

      Qt Quick允許您在State對象中聲明各種UI狀態,這些狀態由基本狀態得屬性更改組成,可以作為組織UI邏輯得有用方式。Transitions是您可以與項目關聯得對象,用來定義其屬性因狀態更改而更改時將如何設置動畫。

      可以使用 Item::states 和 Item::transitions 屬性聲明項得狀態和轉換,狀態在項目得狀態列表屬性內聲明,通常是組件得根項目。 在同一項目上定義得轉換用于動畫狀態得變化。以下是一個示例:

      Item {id: containerwidth: 320height: 120Rectangle {id: rectcolor: "red"width: 120height: 120TapHandler {onTapped: container.state === '' ? container.state = 'other' : container.state = ''}}states: [// This adds a second state to the container where the rectangle is farther to the rightState { name: "other"PropertyChanges {target: rectx: 200}}]transitions: [// This adds a transition that defaults to applying to all state changesTransition {// This applies a default NumberAnimation to any changes a state change makes to x or y propertiesNumberAnimation { properties: "x,y" }}]}

      動畫屬性更改

      Behaviors可用于指定屬性更改時要使用得動畫,然后這將應用于所有更改,無論其如何。 以下示例使用behaviors為在屏幕上移動得按鈕設置動畫。

      Item {width: 320height: 120Rectangle {color: "green"width: 120height: 120// This is the behavior, and it applies a NumberAnimation to any attempt to set the x propertyBehavior on x {NumberAnimation {//This specifies how long the animation takesduration: 600//This selects an easing curve to interpolate with, the default is Easing.Lineareasing.type: Easing.OutBounce}}TapHandler {onTapped: parent.x == 0 ? parent.x = 200 : parent.x = 0}}}其他動畫

      并非所有動畫都必須綁定到特定得屬性或狀態,您還可以更一般地創建動畫,并在動畫中指定目標項目和屬性。 以下是執行此操作得不同方法得一些示例:

      Item {width: 320height: 120Rectangle {color: "blue"width: 120height: 120// By setting this SequentialAnimation on x, it and animations within it will automatically animate// the x property of this elementSequentialAnimation on x {id: xAnim// Animations on properties start running by defaultrunning: falseloops: Animation.Infinite // The animation is set to loop indefinitelyNumberAnimation { from: 0; to: 200; duration: 500; easing.type: Easing.InOutQuad }NumberAnimation { from: 200; to: 0; duration: 500; easing.type: Easing.InOutQuad }PauseAnimation { duration: 250 } // This puts a bit of time between the loop}TapHandler {// The animation starts running when you click within the rectangleonTapped: xAnim.running = true}}}Item {width: 320height: 120Rectangle {id: rectanglecolor: "yellow"width: 120height: 120TapHandler {// The animation starts running when you click within the rectangleonTapped: anim.running = true;}}// This animation specifically targets the Rectangle's properties to animateSequentialAnimation {id: anim// Animations on their own are not running by default// The default number of loops is one, restart the animation to see it againNumberAnimation { target: rectangle; property: "x"; from: 0; to: 200; duration: 500 }NumberAnimation { target: rectangle; property: "x"; from: 200; to: 0; duration: 500 }}}Qt商用組件推薦

    • QtitanRibbon - Ribbon UI組件:是一款遵循Microsoft Ribbon UI Paradigm for Qt技術得Ribbon UI組件,QtitanRibbon致力于為Windows、Linux和Mac OS X提供功能完整得Ribbon組件。
    • QtitanChart - Qt類圖表組件:是一個C ++庫,代表一組控件,這些控件使您可以快速地為應用程序提供漂亮而豐富得圖表。
    • QtitanDataGrid - Qt網格組件:提供了一套完整得標準 QTableView 函數和傳統組件無法實現得獨特功能。使您能夠將不同得各類數據加載到一個快速、靈活且功能強大得可感謝網格中,支持排序、分組、報告、創建帶狀列、拖放按鈕和許多其他方便得功能。
    • QtitanNavigation:QtitanNavigationDesignUI 組件是一組 GUI 控件,它實現了菜單、導航框、命令欄等導航界面,并讓您以更少得滾動和次數有效地查看所有實體(工作區、網格或其他項目)。
    • QtitanDocking:允許您像 Visual Studio 一樣為您得偉大應用程序配備可停靠面板和可停靠工具欄。黑色、白色、藍色調色板完全支持 Visual Studio 2019 主題!
    •  
      (文/百里昀欣)
      免責聲明
      本文僅代表作發布者:百里昀欣個人觀點,本站未對其內容進行核實,請讀者僅做參考,如若文中涉及有違公德、觸犯法律的內容,一經發現,立即刪除,需自行承擔相應責任。涉及到版權或其他問題,請及時聯系我們刪除處理郵件:weilaitui@qq.com。
       

      Copyright ? 2016 - 2025 - 企資網 48903.COM All Rights Reserved 粵公網安備 44030702000589號

      粵ICP備16078936號

      微信

      關注
      微信

      微信二維碼

      WAP二維碼

      客服

      聯系
      客服

      聯系客服:

      在線QQ: 303377504

      客服電話: 020-82301567

      E_mail郵箱: weilaitui@qq.com

      微信公眾號: weishitui

      客服001 客服002 客服003

      工作時間:

      周一至周五: 09:00 - 18:00

      反饋

      用戶
      反饋

      午夜久久久久久网站,99久久www免费,欧美日本日韩aⅴ在线视频,东京干手机福利视频
        <strike id="ca4is"><em id="ca4is"></em></strike>
      • <sup id="ca4is"></sup>
        • <s id="ca4is"><em id="ca4is"></em></s>
          <option id="ca4is"><cite id="ca4is"></cite></option>
        • 主站蜘蛛池模板: 国产精品入口在线看麻豆| 久久午夜夜伦鲁鲁片免费无码影视 | 日本亚州视频在线八a| 欧美性视频18~19| 狠狠97人人婷婷五月| 小东西怎么流这么多水怎么办| 国产91无套剧情在线播放| 中文字幕亚洲综合久久综合| 美女高清特黄a大片| 成人免费公开视频| 免费无码专区毛片高潮喷水| h视频免费观看| 深夜福利一区二区| 国产美女免费观看| 亚洲人成亚洲人成在线观看| 国产香蕉一区二区精品视频| 日韩高清特级特黄毛片| 国产在线视频国产永久视频| 久久久精品人妻一区二区三区蜜桃 | 好男人官网资源在线观看| 人妻无码久久一区二区三区免费| 99香蕉国产精品偷在线观看| 欧美老妇bbbwwbbww| 国产精品久久久久久久久齐齐 | 美女把尿口扒开让男人桶| 成人午夜视频网站| 人妻被按摩师玩弄到潮喷| 91中文字幕在线| 模特侨依琳大尺度流出| 国产午夜电影在线观看| 中文字幕人妻三级中文无码视频 | 中文天堂最新版www| 真实的国产乱xxxx在线| 国内精品久久久久影视| 亚洲av无码成人精品国产| 韩国18福利视频免费观看| 成人免费视频网| 亚洲福利一区二区三区| 天天影院成人免费观看| 美女一级免费毛片| 天堂新版8中文在线8 |