151 clickLater(interface, Qt::LeftButton, delay); |
150 clickLater(interface, Qt::LeftButton, delay); |
152 |
151 |
153 // Show dialog and and enter event loop. |
152 // Show dialog and and enter event loop. |
154 connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot())); |
153 connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot())); |
155 const int timeout = 4; |
154 const int timeout = 4; |
156 QTestEventLoop::instance().enterLoop(timeout); |
|
157 QVERIFY(QTestEventLoop::instance().timeout() == false); |
|
158 } |
|
159 |
|
160 |
|
161 /* |
|
162 Test that a non-modal dialog created as a child of a modal dialog is |
|
163 shown in front. |
|
164 */ |
|
165 void tst_MacGui::dialogModality() |
|
166 { |
|
167 QDialog d; |
|
168 d.setModal(true); |
|
169 d.show(); |
|
170 |
|
171 QProgressDialog progress(&d); |
|
172 progress.setValue(2); |
|
173 |
|
174 InterfaceChildPair interface = wn.find(QAccessible::Name, "Cancel", &progress); |
|
175 QVERIFY(interface.iface); |
|
176 const int delay = 2000; |
|
177 clickLater(interface, Qt::LeftButton, delay); |
|
178 |
|
179 connect(&progress, SIGNAL(canceled()), SLOT(exitLoopSlot())); |
|
180 |
|
181 const int timeout = 3; |
|
182 QTestEventLoop::instance().enterLoop(timeout); |
155 QTestEventLoop::instance().enterLoop(timeout); |
183 QVERIFY(QTestEventLoop::instance().timeout() == false); |
156 QVERIFY(QTestEventLoop::instance().timeout() == false); |
184 } |
157 } |
185 |
158 |
186 class PrimaryWindowDialog : public QDialog |
159 class PrimaryWindowDialog : public QDialog |