Rotate Animation
Unsolved
General and Desktop
-
@Wieland i want to rotate a pushbutton or qlabel, can you help me?
-
I think the easiest way to achieve this is to implement a custom
QGraphicsEffect
for rotation. You can then apply this to whatever widget you like and you can animate the rotation withQPropertyAnimation
. -
BTW: If you need a fancy interface use QtQuick. It makes such things much easier:
import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 Window { visible: true Button { id: btn anchors.centerIn: parent text: "Exit" onClicked: Qt.quit() transform: Rotation { origin.x: btn.width/2.0; origin.y: btn.height/2.0; angle: 0 SequentialAnimation on angle { loops: Animation.Infinite PropertyAnimation { to: 360; duration: 1000 } PropertyAnimation { to: 0; duration: 2000 } } } } }