summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-03 23:00:23 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-03 23:00:23 (GMT)
commit897014a47b41dcf2b9d91549be9b96890d5291c7 (patch)
tree91da900adb42122eebdef573c012051ea511e42d /examples
parent37cdd053623bfadded77ba6ad34e0d4c45158cc7 (diff)
parent2076f150995e541308b1d8da936b3e12ab68b886 (diff)
downloadQt-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.cpp6
-rw-r--r--examples/phonon/musicplayer/mainwindow.cpp5
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();