diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-08-03 23:00:23 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-08-03 23:00:23 (GMT) |
commit | 897014a47b41dcf2b9d91549be9b96890d5291c7 (patch) | |
tree | 91da900adb42122eebdef573c012051ea511e42d /examples | |
parent | 37cdd053623bfadded77ba6ad34e0d4c45158cc7 (diff) | |
parent | 2076f150995e541308b1d8da936b3e12ab68b886 (diff) | |
download | Qt-897014a47b41dcf2b9d91549be9b96890d5291c7.zip Qt-897014a47b41dcf2b9d91549be9b96890d5291c7.tar.gz Qt-897014a47b41dcf2b9d91549be9b96890d5291c7.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'examples')
-rw-r--r-- | examples/animation/stickman/lifecycle.cpp | 6 | ||||
-rw-r--r-- | examples/phonon/musicplayer/mainwindow.cpp | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index c761d87..700916d 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -56,8 +56,9 @@ public: { } KeyPressTransition(GraphicsView *receiver, Qt::Key key, QAbstractState *target) - : QSignalTransition(receiver, SIGNAL(keyPressed(int)), QList<QAbstractState*>() << target), m_key(key) + : QSignalTransition(receiver, SIGNAL(keyPressed(int))), m_key(key) { + setTargetState(target); } virtual bool eventTest(QEvent *e) @@ -78,8 +79,9 @@ class LightningStrikesTransition: public QEventTransition { public: LightningStrikesTransition(QAbstractState *target) - : QEventTransition(this, QEvent::Timer, QList<QAbstractState*>() << target) + : QEventTransition(this, QEvent::Timer) { + setTargetState(target); qsrand((uint)QDateTime::currentDateTime().toTime_t()); startTimer(1000); } diff --git a/examples/phonon/musicplayer/mainwindow.cpp b/examples/phonon/musicplayer/mainwindow.cpp index 7ec86ecf..c3cc5d5 100644 --- a/examples/phonon/musicplayer/mainwindow.cpp +++ b/examples/phonon/musicplayer/mainwindow.cpp @@ -157,9 +157,12 @@ void MainWindow::tableClicked(int row, int /* column */) mediaObject->stop(); mediaObject->clearQueue(); + if (row >= sources.size()) + return; + mediaObject->setCurrentSource(sources[row]); - if (wasPlaying) + if (wasPlaying) mediaObject->play(); else mediaObject->stop(); |