@@ -59,22 +59,28 @@ void TestQgsDockWidget::testSignals()
59
59
QApplication::setActiveWindow ( w ); // required for focus events
60
60
QgsDockWidget* d = new QgsDockWidget ( w );
61
61
62
- QSignalSpy spyClosed ( d, SIGNAL ( closed ( bool ) ) );
63
- QSignalSpy spyOpened ( d, SIGNAL ( opened ( bool ) ) );
62
+ QSignalSpy spyClosedStateChanged ( d, SIGNAL ( closedStateChanged ( bool ) ) );
63
+ QSignalSpy spyClosed ( d, SIGNAL ( closed () ) );
64
+ QSignalSpy spyOpenedStateChanged ( d, SIGNAL ( openedStateChanged ( bool ) ) );
65
+ QSignalSpy spyOpened ( d, SIGNAL ( opened () ) );
64
66
65
67
w->show ();
66
68
67
69
d->show ();
68
- QCOMPARE ( spyClosed.count (), 1 );
69
- QCOMPARE ( spyClosed.last ().at ( 0 ).toBool (), false );
70
+ QCOMPARE ( spyClosedStateChanged.count (), 1 );
71
+ QCOMPARE ( spyClosedStateChanged.last ().at ( 0 ).toBool (), false );
72
+ QCOMPARE ( spyOpenedStateChanged.count (), 1 );
73
+ QCOMPARE ( spyOpenedStateChanged.last ().at ( 0 ).toBool (), true );
74
+ QCOMPARE ( spyClosed.count (), 0 );
70
75
QCOMPARE ( spyOpened.count (), 1 );
71
- QCOMPARE ( spyOpened.last ().at ( 0 ).toBool (), true );
72
76
73
77
d->close ();
74
- QCOMPARE ( spyClosed.count (), 2 );
75
- QCOMPARE ( spyClosed.last ().at ( 0 ).toBool (), true );
76
- QCOMPARE ( spyOpened.count (), 2 );
77
- QCOMPARE ( spyOpened.last ().at ( 0 ).toBool (), false );
78
+ QCOMPARE ( spyClosedStateChanged.count (), 2 );
79
+ QCOMPARE ( spyClosedStateChanged.last ().at ( 0 ).toBool (), true );
80
+ QCOMPARE ( spyOpenedStateChanged.count (), 2 );
81
+ QCOMPARE ( spyOpenedStateChanged.last ().at ( 0 ).toBool (), false );
82
+ QCOMPARE ( spyClosed.count (), 1 );
83
+ QCOMPARE ( spyOpened.count (), 1 );
78
84
79
85
delete w;
80
86
}
0 commit comments