From: Tobias Koenig Date: Sun, 14 Oct 2012 13:11:13 +0000 (+0200) Subject: Add a test for using PropertyAnimation with QSlider... it just rocks! ;) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=cdd2d583795449b415980f4e7b6d6348d156faa1;p=konrad%2FDeclarativeWidgets.git Add a test for using PropertyAnimation with QSlider... it just rocks! ;) --- diff --git a/animation.qml b/animation.qml new file mode 100644 index 0000000..3d75237 --- /dev/null +++ b/animation.qml @@ -0,0 +1,31 @@ +import QtQuick 1.0 +import QtGui 1.0 + +Widget { + VBoxLayout { + PushButton { + id: button + text: anim.running ? qsTr("Stop animation") : qsTr("Start animation") + checkable: true + } + + Slider { + id: slider + + minimum: 0 + maximum: 100 + PropertyAnimation { + id: anim + + running: button.checked + target: slider + property: "value" + from: 0 + to: 100 + duration: 3000 + easing.type: Easing.InOutBounce + loops: Animation.Infinite + } + } + } +} diff --git a/main.cpp b/main.cpp index a52f801..c3e8391 100644 --- a/main.cpp +++ b/main.cpp @@ -12,7 +12,8 @@ int main(int argc, char **argv) timer.setInterval(1000); timer.start(); - DeclarativeWidgetDocument document(QUrl("test.qml")); + //DeclarativeWidgetDocument document(QUrl("test.qml")); + DeclarativeWidgetDocument document(QUrl("animation.qml")); document.setContextProperty("_timer", &timer); QWidget *widget = document.create();