diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-05-22 14:19:21 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-05-22 14:19:21 (GMT) |
commit | 24d798694b794732240e85fa65b958b8c97cbef5 (patch) | |
tree | 050fba2c7812e0721c7628c75ee11bc16dd8232b /tests/auto/qstatemachine | |
parent | 74d54eeabcd648ee5100853299de8af5ac4b36f2 (diff) | |
download | Qt-24d798694b794732240e85fa65b958b8c97cbef5.zip Qt-24d798694b794732240e85fa65b958b8c97cbef5.tar.gz Qt-24d798694b794732240e85fa65b958b8c97cbef5.tar.bz2 |
make sure event transition is correctly unregistered/re-registered
When the eventType or eventObject is changed while the state is active,
the transition needs to be unregistered _before_ either property is
changed, only _then_ can it be re-registered.
Diffstat (limited to 'tests/auto/qstatemachine')
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 8354d03..a5070cb 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1836,6 +1836,19 @@ void tst_QStateMachine::eventTransitions() QCoreApplication::processEvents(); QTest::mouseRelease(&button, Qt::LeftButton); QTRY_COMPARE(finishedSpy.count(), 2); + + machine.start(); + QCoreApplication::processEvents(); + trans->setEventType(QEvent::MouseButtonPress); + QTest::mousePress(&button, Qt::LeftButton); + QTRY_COMPARE(finishedSpy.count(), 3); + + QPushButton button2; + machine.start(); + QCoreApplication::processEvents(); + trans->setEventObject(&button2); + QTest::mousePress(&button2, Qt::LeftButton); + QTRY_COMPARE(finishedSpy.count(), 4); } for (int x = 0; x < 3; ++x) { QStateMachine machine; |