}
#endif
-#if QT_DEPRECATED_SINCE(6, 0)
+#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline static bool qWaitForWindowShown(QWindow *window, int timeout = 1000)
{
return qWaitForWindowExposed(window, timeout);
}
-
+#endif // QT_DEPRECATED_SINCE(5, 0)
+#if QT_DEPRECATED_SINCE(6, 0)
# ifdef QT_WIDGETS_LIB
QT_DEPRECATED inline static bool qWaitForWindowShown(QWidget *widget, int timeout = 1000)
{
// verify active window focus propagates to qguiapplication
- QTest::qWaitForWindowShown(&window1);
window1.requestActivateWindow();
- QTRY_COMPARE(app.focusWindow(), &window1);
+ QVERIFY(QTest::qWaitForWindowActive(&window1));
+ QCOMPARE(app.focusWindow(), &window1);
window1.setFocusObject(&obj1);
QCOMPARE(app.focusObject(), &obj1);
window2.setFocusObject(&obj3);
QCOMPARE(app.focusObject(), &obj2); // not yet changed
window2.show();
- QTest::qWaitForWindowShown(&window2);
+ QVERIFY(QTest::qWaitForWindowExposed(&window2));
QTRY_COMPARE(app.focusWindow(), &window2);
QCOMPARE(app.focusObject(), &obj3);
QCOMPARE(spy.count(), 1);
FocusChangeWindow window1, window2;
window1.show();
window2.show();
- QTest::qWaitForWindowShown(&window1);
- QTest::qWaitForWindowShown(&window2);
+ QVERIFY(QTest::qWaitForWindowExposed(&window1));
+ QVERIFY(QTest::qWaitForWindowExposed(&window2));
window1.requestActivateWindow();
QTRY_COMPARE(app.focusWindow(), &window1);
QWindow *window = new QWindow;
window->show();
- QTest::qWaitForWindowShown(window);
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
// mouse events
// show the 2 windows, nothing is blocked
window1->show();
window2->show();
- QTest::qWaitForWindowShown(window1);
- QTest::qWaitForWindowShown(window2);
+ QVERIFY(QTest::qWaitForWindowExposed(window1));
+ QVERIFY(QTest::qWaitForWindowExposed(window2));
QCOMPARE(app.modalWindow(), static_cast<QWindow *>(0));
QCOMPARE(window1->blocked, 0);
QCOMPARE(window2->blocked, 0);
DummyWindow window;
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
window.requestActivateWindow();
QTRY_COMPARE(qApp->focusWindow(), &window);
window.setFocusObject(&disabledItem);
QWindow *w = new QWindow;
w->setGeometry(100, 100, 100, 100);
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
WindowTouchEventFilter filter;
w->installEventFilter(&filter);
QWindow *w = new QWindow;
w->setGeometry(100, 100, 100, 100);
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
WindowTouchEventFilter filter;
w->installEventFilter(&filter);
InputTestWindow window;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier);
window.ignoreTouch = true;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QList<QWindowSystemInterface::TouchPoint> points;
QWindowSystemInterface::TouchPoint tp1, tp2;
window.ignoreMouse = true;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
window.ignoreTouch = true;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
InputTestWindow window;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QList<QWindowSystemInterface::TouchPoint> points;
QWindowSystemInterface::TouchPoint tp1;
window.ignoreTouch = true;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QList<QWindowSystemInterface::TouchPoint> points;
QWindowSystemInterface::TouchPoint tp1;
for (int i = 0; i < 10; ++i) {
QWindow window;
window.show();
- QTest::qWaitForWindowShown(&window);
window.requestActivateWindow();
- QTRY_COMPARE(qGuiApp->focusWindow(), &window);
+ QVERIFY(QTest::qWaitForWindowActive(&window));
+ QCOMPARE(qGuiApp->focusWindow(), &window);
}
}
InputTestWindow window;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
ulong timestamp = 0;
QPointF local(12, 34);
window.setGeometry(80, 80, 40, 40);
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
// Queue three events.
QPointF local(12, 34);
CustomView view;
view.setScene(&scene);
view.show();
- QTest::qWaitForWindowShown(view.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
qApp->processEvents();
view.repaints = 0;
view.rotate(10);
view.scale(1.7, 1.7);
view.show();
- QTest::qWaitForWindowShown(view.windowHandle());
qApp->setActiveWindow(&view);
view.activateWindow();
- QTest::qWait(70);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
QCursor::setPos(view.mapToGlobal(QPoint(-5, -5)));
QGraphicsView view(&scene);
view.show();
- QTest::qWaitForWindowShown(view.windowHandle());
view.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
view.centerOn(item);
{
QGraphicsView view(&scene, &topLevel);
view.resize(200, 200);
topLevel.show();
- QTest::qWaitForWindowShown(topLevel.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
{
QPoint pos(50, 50);
container.show();
container.activateWindow();
qApp->setActiveWindow(&container);
- QTest::qWaitForWindowShown(container.windowHandle());
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowActive(&container));
QTRY_VERIFY(lastEdit->hasFocus());
container.tab();
widgetToSave.move(expectedPosition);
widgetToSave.resize(expectedSize);
widgetToSave.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTest::qWait(500); // stabilize
widgetToSave.setWindowState(Qt::WindowStates(expectedWindowState));
QTest::qWait(500); // stabilize
parent.show();
- QTest::qWaitForWindowShown(parent.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&parent));
QWindowSystemInterface::handleMouseEvent(parent.windowHandle(), QPointF(5, 5), QPointF(), Qt::LeftButton, Qt::NoModifier);
QTest::qWait(100);
popup.show();
- QTest::qWaitForWindowShown(popup.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&popup));
QTest::qWait(100);
QCOMPARE(widget.size(), newMaximumSize);
widget.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QCOMPARE(widget.size(), newMaximumSize);
}
QCOMPARE(widget.size(), newMinimumSize);
widget.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QCOMPARE(widget.size(), newMinimumSize);
}
}
// show it
widget.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowShown(&widget));
QTest::qWait(100);
// it should have moved
QCOMPARE(widget.pos(), position);
QWidget greatGrandChild(&grandChild);
parent.show();
- QTest::qWaitForWindowShown(parent.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&parent));
// Verify that the WA_WState_Created attribute is set
// and the top-level is the only native window.
UpdateWidget updateWidget;
updateWidget.show();
- QTest::qWaitForWindowShown(updateWidget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&updateWidget));
qApp->processEvents();
updateWidget.reset();
greatGrandChild.setAutoFillBackground(true); // Opaque child widget.
widget.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTest::qWait(100);
// Child, grandChild and greatGrandChild are outside the ancestor clip.
QWidget *widget = new UpdateWidget;
widget->show();
- QTest::qWaitForWindowShown(widget->windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(widget));
QTest::qWait(200);
static_cast<UpdateWidget *>(widget)->numPaintEvents = 0;
const QPoint labelPos = qApp->desktop()->availableGeometry().topLeft();
label.move(labelPos);
label.show();
- QTest::qWaitForWindowShown(label.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&label));
QTest::qWait(200);
QPixmap widgetSnapshot;
window.show();
window.raise();
- QTest::qWaitForWindowShown(window.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QTest::qWait(300);
#define RESET_EVENT_COUNTS \
SELChild child(&parent);
child.resize(200, 200);
parent.show();
- QTest::qWaitForWindowShown(parent.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&parent));
QTest::qWait(150);
QCursor::setPos(child.mapToGlobal(QPoint(100, 100)));
child->setPalette(Qt::red);
widget.show();
- QTest::qWaitForWindowShown(widget.windowHandle());
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTest::qWait(200);
// Please do not crash.