diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-08-02 23:41:38 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-08-02 23:41:38 (GMT) |
commit | 98bb5c8cbdef20d060c45a399068580eacf93ae4 (patch) | |
tree | b16faf2c64bb76945b75c4000c234457e5261a6e /examples | |
parent | aa9cf406d62004519ad54596e1c391f9a6439210 (diff) | |
parent | 5aed3db0a4084f470769ad4b965001f17b878c79 (diff) | |
download | Qt-98bb5c8cbdef20d060c45a399068580eacf93ae4.zip Qt-98bb5c8cbdef20d060c45a399068580eacf93ae4.tar.gz Qt-98bb5c8cbdef20d060c45a399068580eacf93ae4.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gestures/imageviewer/main.cpp | 3 | ||||
-rw-r--r-- | examples/graphicsview/collidingmice/mouse.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/gestures/imageviewer/main.cpp b/examples/gestures/imageviewer/main.cpp index 6bda418..cd1928b 100644 --- a/examples/gestures/imageviewer/main.cpp +++ b/examples/gestures/imageviewer/main.cpp @@ -81,6 +81,9 @@ int main(int argc, char *argv[]) if (QApplication::arguments().size() > 1) w.openDirectory(QApplication::arguments().at(1)); + else + w.openDirectory(QFileDialog::getExistingDirectory(0, "Select image folder")); + return app.exec(); } diff --git a/examples/graphicsview/collidingmice/mouse.cpp b/examples/graphicsview/collidingmice/mouse.cpp index c6a67b1..4cc29dd 100644 --- a/examples/graphicsview/collidingmice/mouse.cpp +++ b/examples/graphicsview/collidingmice/mouse.cpp @@ -64,7 +64,7 @@ Mouse::Mouse() : angle(0), speed(0), mouseEyeDirection(0), color(qrand() % 256, qrand() % 256, qrand() % 256) { - rotate(qrand() % (360 * 16)); + setRotation(qrand() % (360 * 16)); } //! [0] @@ -195,7 +195,7 @@ void Mouse::advance(int step) qreal dx = ::sin(angle) * 10; mouseEyeDirection = (qAbs(dx / 5) < 1) ? 0 : dx / 5; - rotate(dx); + setRotation(rotation() + dx); setPos(mapToParent(0, -(3 + sin(speed) * 3))); } //! [11] |