[英]Qt GUI animations?
有點奇怪的問題,但是我最近發現有一種方法可以為Qt GUI制作動畫。 我真的很想找到一種方法可以將主窗口擴展為更大的窗口,但是與其立即調整其大小(這很簡單),還不如想讓它以動畫形式擴展。 更重要的是,制作此類動畫的正確方法是什么?
我要附上2張圖片,顯示初始窗口和最終擴展的窗口(或至少我的設想)。
(需要在動畫方面逐步擴展到以下內容)
謝謝大家。
如果您不使用QML,則需要使用某種技巧,在您自己的事件觸發的循環中使小部件的去脂/增加大小。 緩和曲線可以幫助您實現平滑效果https://doc.qt.io/qt-5/qeasingcurve.html 。
由於您使用的是QML,因此對您來說這很簡單。 最簡單的方法是將行為與平滑動畫結合使用。 下面的瑣碎示例。
ApplicationWindow { width: base.size height: base.size Item { id: base property real size: 400 Behavior on size { SmoothedAnimation { duration: 1000 } } anchors.fill: parent MouseArea { anchors.fill: parent onClicked: base.size += 100 } } }
[英]Simple QImage animations in Qt
[英]QT widgets vs QT GUI
[英]Are there any native Window animations in Qt 4?
[英]RTSP Client with Qt GUI
[英]Qt Gui Application deployment
[英]Qt - GUI Database programming
[英]Qt GUI in a library?
[英]Creating a GUI using Qt
[英]Is a define available for Qt gui?
[英]Qt - GUI freezing
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.