diff options
author | André Klitzing <aklitzing@gmail.com> | 2014-12-10 15:18:49 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-20 06:36:26 +0100 |
commit | ebd33883e79b458639e8fe118ccc285641223203 (patch) | |
tree | 224f18a9c940f39e19b2edadef4e89109633a5b1 /tests/auto/corelib/statemachine/qstate | |
parent | 86d04cfe2bdceca401cab228bd63245f16e65731 (diff) |
QState: Added template PointerToMemberFunction
Added the function pointer to addTransition to take
advantage of the new connect syntax.
[ChangeLog][QtCore][State Machine] Added an addTransition() overload that
takes a pointer-to-member for the signal triggering the transition.
Change-Id: Ic97f7983839217ca0c8484b269d38221cbe804e3
Task-number: QTBUG-40293
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/statemachine/qstate')
-rw-r--r-- | tests/auto/corelib/statemachine/qstate/tst_qstate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp index 820039b6a9..7592a0cee1 100644 --- a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp +++ b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp @@ -205,12 +205,16 @@ void tst_QState::transitions() QVERIFY(s1.transitions().isEmpty()); QAbstractTransition *t1 = s1.addTransition(this, SIGNAL(destroyed()), &s2); + QAbstractTransition *t1_1 = s1.addTransition(this, &tst_QState::destroyed, &s2); QVERIFY(t1 != 0); - QCOMPARE(s1.transitions().count(), 1); + QVERIFY(t1_1 != 0); + QCOMPARE(s1.transitions().count(), 2); QCOMPARE(s1.transitions().first(), t1); + QCOMPARE(s1.transitions().last(), t1_1); QVERIFY(s2.transitions().isEmpty()); s1.removeTransition(t1); + s1.removeTransition(t1_1); QVERIFY(s1.transitions().isEmpty()); s1.addTransition(t1); |