From ebd33883e79b458639e8fe118ccc285641223203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Wed, 10 Dec 2014 15:18:49 +0100 Subject: 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 --- tests/auto/corelib/statemachine/qstate/tst_qstate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') 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); -- cgit v1.2.3