diff options
Diffstat (limited to 'tests/auto/qbuttongroup/tst_qbuttongroup.cpp')
-rw-r--r-- | tests/auto/qbuttongroup/tst_qbuttongroup.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp index a610a7f..1831e5d 100644 --- a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp @@ -396,19 +396,20 @@ void tst_QButtonGroup::task106609() vbox->addWidget(radio2); buttons->addButton(radio3, 3); vbox->addWidget(radio3); - - radio1->setFocus(); - radio1->setChecked(true); dlg.show(); + QTest::qWaitForWindowShown(&dlg); qRegisterMetaType<QAbstractButton*>("QAbstractButton*"); QSignalSpy spy1(buttons, SIGNAL(buttonClicked(QAbstractButton*))); QSignalSpy spy2(buttons, SIGNAL(buttonClicked(int))); - QTestEventLoop::instance().enterLoop(1); QApplication::setActiveWindow(&dlg); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&dlg)); + radio1->setFocus(); + radio1->setChecked(true); + QTestEventLoop::instance().enterLoop(1); + //qDebug() << "int:" << spy2.count() << "QAbstractButton*:" << spy1.count(); QCOMPARE(spy2.count(), 2); QCOMPARE(spy1.count(), 2); |