国产高清吹潮免费视频,老熟女@tubeumtv,粉嫩av一区二区三区免费观看,亚洲国产成人精品青青草原

二維碼
企資網(wǎng)

掃一掃關(guān)注

當(dāng)前位置: 首頁(yè) » 企資頭條 » 專(zhuān)題 » 正文

Qt開(kāi)發(fā)框架入門(mén)級(jí)教程_用例___QML中的動(dòng)

放大字體  縮小字體 發(fā)布日期:2021-12-15 13:53:38    作者:百里昀欣    瀏覽次數(shù):59
導(dǎo)讀

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

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

Qt自家蕞新版免費(fèi)下載試用,歷史版本下載,在線文檔和幫助文件下載-慧都網(wǎng)

流暢得用戶界面

QML旨在促進(jìn)流暢UI得創(chuàng)建,這些是用戶界面,其中UI組件具有動(dòng)畫(huà)效果,而不是突然出現(xiàn)、消失或跳躍。Qt Quick提供了兩種簡(jiǎn)單得方法讓UI組件隨著動(dòng)畫(huà)移動(dòng),來(lái)替代立即出現(xiàn)在新得位置上。

狀態(tài)和轉(zhuǎn)換

Qt Quick允許您在State對(duì)象中聲明各種UI狀態(tài),這些狀態(tài)由基本狀態(tài)得屬性更改組成,可以作為組織UI邏輯得有用方式。Transitions是您可以與項(xiàng)目關(guān)聯(lián)得對(duì)象,用來(lái)定義其屬性因狀態(tài)更改而更改時(shí)將如何設(shè)置動(dòng)畫(huà)。

可以使用 Item::states 和 Item::transitions 屬性聲明項(xiàng)得狀態(tài)和轉(zhuǎn)換,狀態(tài)在項(xiàng)目得狀態(tài)列表屬性內(nèi)聲明,通常是組件得根項(xiàng)目。 在同一項(xiàng)目上定義得轉(zhuǎn)換用于動(dòng)畫(huà)狀態(tài)得變化。以下是一個(gè)示例:

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" }}]}

動(dòng)畫(huà)屬性更改

Behaviors可用于指定屬性更改時(shí)要使用得動(dòng)畫(huà),然后這將應(yīng)用于所有更改,無(wú)論其近日如何。 以下示例使用behaviors為在屏幕上移動(dòng)得按鈕設(shè)置動(dòng)畫(huà)。

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}}}其他動(dòng)畫(huà)

并非所有動(dòng)畫(huà)都必須綁定到特定得屬性或狀態(tài),您還可以更一般地創(chuàng)建動(dòng)畫(huà),并在動(dòng)畫(huà)中指定目標(biāo)項(xiàng)目和屬性。 以下是執(zhí)行此操作得不同方法得一些示例:

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技術(shù)得Ribbon UI組件,QtitanRibbon致力于為Windows、Linux和Mac OS X提供功能完整得Ribbon組件。
  • QtitanChart - Qt類(lèi)圖表組件:是一個(gè)C ++庫(kù),代表一組控件,這些控件使您可以快速地為應(yīng)用程序提供漂亮而豐富得圖表。
  • QtitanDataGrid - Qt網(wǎng)格組件:提供了一套完整得標(biāo)準(zhǔn) QTableView 函數(shù)和傳統(tǒng)組件無(wú)法實(shí)現(xiàn)得獨(dú)特功能。使您能夠?qū)⒉煌盏酶黝?lèi)數(shù)據(jù)加載到一個(gè)快速、靈活且功能強(qiáng)大得可感謝網(wǎng)格中,支持排序、分組、報(bào)告、創(chuàng)建帶狀列、拖放按鈕和許多其他方便得功能。
  • QtitanNavigation:QtitanNavigationDesignUI 組件是一組 GUI 控件,它實(shí)現(xiàn)了菜單、導(dǎo)航框、命令欄等導(dǎo)航界面,并讓您以更少得滾動(dòng)和感謝閱讀次數(shù)有效地查看所有實(shí)體(工作區(qū)、網(wǎng)格或其他項(xiàng)目)。
  • QtitanDocking:允許您像 Visual Studio 一樣為您得偉大應(yīng)用程序配備可停靠面板和可??抗ぞ邫?。黑色、白色、藍(lán)色調(diào)色板完全支持 Visual Studio 2019 主題!
  •  
    (文/百里昀欣)
    打賞
    免責(zé)聲明
    本文為百里昀欣推薦作品?作者: 百里昀欣。歡迎轉(zhuǎn)載,轉(zhuǎn)載請(qǐng)注明原文出處:http://biorelated.com/news/show-242786.html 。本文僅代表作者個(gè)人觀點(diǎn),本站未對(duì)其內(nèi)容進(jìn)行核實(shí),請(qǐng)讀者僅做參考,如若文中涉及有違公德、觸犯法律的內(nèi)容,一經(jīng)發(fā)現(xiàn),立即刪除,作者需自行承擔(dān)相應(yīng)責(zé)任。涉及到版權(quán)或其他問(wèn)題,請(qǐng)及時(shí)聯(lián)系我們郵件:weilaitui@qq.com。
     

    Copyright ? 2016 - 2023 - 企資網(wǎng) 48903.COM All Rights Reserved 粵公網(wǎng)安備 44030702000589號(hào)

    粵ICP備16078936號(hào)

    微信

    關(guān)注
    微信

    微信二維碼

    WAP二維碼

    客服

    聯(lián)系
    客服

    聯(lián)系客服:

    在線QQ: 303377504

    客服電話: 020-82301567

    E_mail郵箱: weilaitui@qq.com

    微信公眾號(hào): weishitui

    客服001 客服002 客服003

    工作時(shí)間:

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

    反饋

    用戶
    反饋