Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
parent
0838ac541d
commit
305cdc7355
@ -412,7 +412,7 @@ void tst_QGraphicsEffect::opacity()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTRY_VERIFY(effect->numRepaints > 0);
|
QTRY_VERIFY(effect->numRepaints > 0);
|
||||||
QCOMPARE(effect->m_opacity, qreal(0.5));
|
QCOMPARE(effect->m_opacity, qreal(0.5));
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ void tst_QGraphicsEffect::drawPixmapItem()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTRY_VERIFY(effect->repaints >= 1);
|
QTRY_VERIFY(effect->repaints >= 1);
|
||||||
|
|
||||||
item->rotate(180);
|
item->rotate(180);
|
||||||
@ -593,7 +593,7 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QTRY_VERIFY(item->numRepaints >= 1);
|
QTRY_VERIFY(item->numRepaints >= 1);
|
||||||
int numRepaints = item->numRepaints;
|
int numRepaints = item->numRepaints;
|
||||||
@ -619,7 +619,7 @@ void tst_QGraphicsEffect::inheritOpacity()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QTRY_VERIFY(item->numRepaints >= 1);
|
QTRY_VERIFY(item->numRepaints >= 1);
|
||||||
|
|
||||||
@ -679,7 +679,7 @@ void tst_QGraphicsEffect::childrenVisibilityShouldInvalidateCache()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_VERIFY(parent.nbPaint >= 1);
|
QTRY_VERIFY(parent.nbPaint >= 1);
|
||||||
//we set an effect on the parent
|
//we set an effect on the parent
|
||||||
parent.setGraphicsEffect(new QGraphicsDropShadowEffect(&parent));
|
parent.setGraphicsEffect(new QGraphicsDropShadowEffect(&parent));
|
||||||
|
@ -1559,7 +1559,7 @@ void tst_QGraphicsItem::selected()
|
|||||||
view.setFixedSize(250, 250);
|
view.setFixedSize(250, 250);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
@ -1688,7 +1688,7 @@ void tst_QGraphicsItem::selected_textItem()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
|
|
||||||
QTRY_VERIFY(!text->isSelected());
|
QTRY_VERIFY(!text->isSelected());
|
||||||
@ -3369,7 +3369,7 @@ void tst_QGraphicsItem::childrenBoundingRect()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(30);
|
QTest::qWait(30);
|
||||||
|
|
||||||
QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800));
|
QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800));
|
||||||
@ -3470,7 +3470,7 @@ void tst_QGraphicsItem::childrenBoundingRect4()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
// Try to mess up the cached bounding rect.
|
// Try to mess up the cached bounding rect.
|
||||||
rect->childrenBoundingRect();
|
rect->childrenBoundingRect();
|
||||||
@ -3494,7 +3494,7 @@ void tst_QGraphicsItem::childrenBoundingRect5()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
// Try to mess up the cached bounding rect.
|
// Try to mess up the cached bounding rect.
|
||||||
QRectF expectedChildrenBoundingRect = parent->boundingRect();
|
QRectF expectedChildrenBoundingRect = parent->boundingRect();
|
||||||
@ -3529,8 +3529,7 @@ void tst_QGraphicsItem::group()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
|
||||||
|
|
||||||
QGraphicsItemGroup *group = new QGraphicsItemGroup;
|
QGraphicsItemGroup *group = new QGraphicsItemGroup;
|
||||||
group->setSelected(true);
|
group->setSelected(true);
|
||||||
@ -3767,7 +3766,7 @@ void tst_QGraphicsItem::handlesChildEvents()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
|
|
||||||
// Pull out the items, closest item first
|
// Pull out the items, closest item first
|
||||||
@ -3891,7 +3890,7 @@ void tst_QGraphicsItem::handlesChildEvents2()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
|
QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
|
||||||
@ -3980,7 +3979,7 @@ void tst_QGraphicsItem::filtersChildEvents()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
|
|
||||||
QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
|
QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
|
||||||
@ -4051,7 +4050,7 @@ void tst_QGraphicsItem::filtersChildEvents2()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
|
QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
|
||||||
@ -4099,7 +4098,7 @@ void tst_QGraphicsItem::ensureVisible()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setFixedSize(300, 300);
|
view.setFixedSize(300, 300);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
for (int i = 0; i < 25; ++i) {
|
for (int i = 0; i < 25; ++i) {
|
||||||
view.scale(qreal(1.06), qreal(1.06));
|
view.scale(qreal(1.06), qreal(1.06));
|
||||||
@ -5014,7 +5013,7 @@ void tst_QGraphicsItem::sceneEventFilter()
|
|||||||
QGraphicsTextItem *ti3 = anotherScene->addText("This is a test #3");
|
QGraphicsTextItem *ti3 = anotherScene->addText("This is a test #3");
|
||||||
gv.setScene(anotherScene);
|
gv.setScene(anotherScene);
|
||||||
gv.show();
|
gv.show();
|
||||||
QTest::qWaitForWindowShown(&gv);
|
QVERIFY(QTest::qWaitForWindowExposed(&gv));
|
||||||
QTest::qWait(25);
|
QTest::qWait(25);
|
||||||
ti->installSceneEventFilter(ti2);
|
ti->installSceneEventFilter(ti2);
|
||||||
ti3->installSceneEventFilter(ti);
|
ti3->installSceneEventFilter(ti);
|
||||||
@ -5072,7 +5071,7 @@ void tst_QGraphicsItem::paint()
|
|||||||
view.showFullScreen();
|
view.showFullScreen();
|
||||||
else
|
else
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
//we try to switch the desktop: if it fails, we skip the test
|
//we try to switch the desktop: if it fails, we skip the test
|
||||||
@ -5088,7 +5087,7 @@ void tst_QGraphicsItem::paint()
|
|||||||
QGraphicsScene scene2;
|
QGraphicsScene scene2;
|
||||||
QGraphicsView view2(&scene2);
|
QGraphicsView view2(&scene2);
|
||||||
view2.show();
|
view2.show();
|
||||||
QTest::qWaitForWindowShown(&view2);
|
QVERIFY(QTest::qWaitForWindowExposed(&view2));
|
||||||
QTest::qWait(25);
|
QTest::qWait(25);
|
||||||
|
|
||||||
PaintTester tester2;
|
PaintTester tester2;
|
||||||
@ -6094,7 +6093,7 @@ void tst_QGraphicsItem::untransformable()
|
|||||||
view.setBackgroundBrush(QBrush(Qt::black, Qt::DiagCrossPattern));
|
view.setBackgroundBrush(QBrush(Qt::black, Qt::DiagCrossPattern));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
|
||||||
|
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
QPoint center = view.viewport()->rect().center();
|
QPoint center = view.viewport()->rect().center();
|
||||||
@ -6157,7 +6156,7 @@ void tst_QGraphicsItem::contextMenuEventPropagation()
|
|||||||
view.setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
view.setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||||
view.show();
|
view.show();
|
||||||
view.resize(200, 200);
|
view.resize(200, 200);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
|
|
||||||
QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10),
|
QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10),
|
||||||
@ -6259,7 +6258,7 @@ void tst_QGraphicsItem::task141694_textItemEnsureVisible()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setFixedSize(200, 200);
|
view.setFixedSize(200, 200);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
view.ensureVisible(-1000, -1000, 5, 5);
|
view.ensureVisible(-1000, -1000, 5, 5);
|
||||||
int hscroll = view.horizontalScrollBar()->value();
|
int hscroll = view.horizontalScrollBar()->value();
|
||||||
@ -6433,7 +6432,7 @@ void tst_QGraphicsItem::ensureUpdateOnTextItem()
|
|||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(25);
|
QTest::qWait(25);
|
||||||
TextItem *text1 = new TextItem(QLatin1String("123"));
|
TextItem *text1 = new TextItem(QLatin1String("123"));
|
||||||
scene.addItem(text1);
|
scene.addItem(text1);
|
||||||
@ -6860,7 +6859,7 @@ void tst_QGraphicsItem::itemStacksBehindParent()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTRY_VERIFY(!paintedItems.isEmpty());
|
QTRY_VERIFY(!paintedItems.isEmpty());
|
||||||
QTest::qWait(100);
|
QTest::qWait(100);
|
||||||
paintedItems.clear();
|
paintedItems.clear();
|
||||||
@ -6958,7 +6957,7 @@ void tst_QGraphicsItem::nestedClipping()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(25);
|
QTest::qWait(25);
|
||||||
|
|
||||||
QList<QGraphicsItem *> expected;
|
QList<QGraphicsItem *> expected;
|
||||||
@ -7173,7 +7172,7 @@ void tst_QGraphicsItem::cacheMode()
|
|||||||
view.resize(150, 150);
|
view.resize(150, 150);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
|
||||||
// Increase the probability of window activation
|
// Increase the probability of window activation
|
||||||
// not causing another repaint of test items.
|
// not causing another repaint of test items.
|
||||||
@ -7367,7 +7366,7 @@ void tst_QGraphicsItem::cacheMode2()
|
|||||||
view.resize(150, 150);
|
view.resize(150, 150);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
|
||||||
// Increase the probability of window activation
|
// Increase the probability of window activation
|
||||||
// not causing another repaint of test items.
|
// not causing another repaint of test items.
|
||||||
@ -7444,7 +7443,7 @@ void tst_QGraphicsItem::updateCachedItemAfterMove()
|
|||||||
scene.addItem(tester);
|
scene.addItem(tester);
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QTest::qWait(12);
|
QTest::qWait(12);
|
||||||
QTRY_VERIFY(tester->repaints > 0);
|
QTRY_VERIFY(tester->repaints > 0);
|
||||||
@ -7870,7 +7869,7 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption()
|
|||||||
topLevel.setWindowFlags(Qt::X11BypassWindowManagerHint);
|
topLevel.setWindowFlags(Qt::X11BypassWindowManagerHint);
|
||||||
rect->startTrack = false;
|
rect->startTrack = false;
|
||||||
topLevel.show();
|
topLevel.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
|
||||||
QTest::qWait(60);
|
QTest::qWait(60);
|
||||||
rect->startTrack = true;
|
rect->startTrack = true;
|
||||||
rect->update(10, 10, 10, 10);
|
rect->update(10, 10, 10, 10);
|
||||||
@ -9059,8 +9058,9 @@ void tst_QGraphicsItem::ensureDirtySceneTransform()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
|
|
||||||
//We move the parent
|
//We move the parent
|
||||||
parent->move();
|
parent->move();
|
||||||
@ -9349,8 +9349,9 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
||||||
|
|
||||||
QTRY_COMPARE(tester->repaints, 1);
|
QTRY_COMPARE(tester->repaints, 1);
|
||||||
|
|
||||||
@ -10427,7 +10428,7 @@ void tst_QGraphicsItem::textItem_shortcuts()
|
|||||||
item->setFlag(QGraphicsItem::ItemIsFocusable);
|
item->setFlag(QGraphicsItem::ItemIsFocusable);
|
||||||
item->setTextInteractionFlags(Qt::TextEditorInteraction);
|
item->setTextInteractionFlags(Qt::TextEditorInteraction);
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||||
|
|
||||||
item->setFocus();
|
item->setFocus();
|
||||||
QTRY_VERIFY(item->hasFocus());
|
QTRY_VERIFY(item->hasFocus());
|
||||||
@ -10589,7 +10590,7 @@ void tst_QGraphicsItem::focusHandling()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
@ -10674,7 +10675,7 @@ void tst_QGraphicsItem::touchEventPropagation()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setSceneRect(touchEventReceiver->boundingRect());
|
view.setSceneRect(touchEventReceiver->boundingRect());
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(touchEventReceiver->touchBeginEventCount, 0);
|
QCOMPARE(touchEventReceiver->touchBeginEventCount, 0);
|
||||||
|
|
||||||
@ -10710,7 +10711,7 @@ void tst_QGraphicsItem::deviceCoordinateCache_simpleRotations()
|
|||||||
|
|
||||||
MyGraphicsView view(&scene);
|
MyGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTRY_VERIFY(view.repaints > 0);
|
QTRY_VERIFY(view.repaints > 0);
|
||||||
|
|
||||||
QGraphicsItemCache *itemCache = QGraphicsItemPrivate::get(item)->extraItemCache();
|
QGraphicsItemCache *itemCache = QGraphicsItemPrivate::get(item)->extraItemCache();
|
||||||
@ -10790,7 +10791,7 @@ void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
|
|||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
scene.addItem(i);
|
scene.addItem(i);
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_VERIFY(i->painted);
|
QTRY_VERIFY(i->painted);
|
||||||
@ -11126,8 +11127,8 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
|
|||||||
scene.addItem(item);
|
scene.addItem(item);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
||||||
QGraphicsSceneDragDropEvent dragEnter(QEvent::GraphicsSceneDragEnter);
|
QGraphicsSceneDragDropEvent dragEnter(QEvent::GraphicsSceneDragEnter);
|
||||||
dragEnter.setScenePos(item->boundingRect().center());
|
dragEnter.setScenePos(item->boundingRect().center());
|
||||||
QApplication::sendEvent(&scene, &dragEnter);
|
QApplication::sendEvent(&scene, &dragEnter);
|
||||||
@ -11153,8 +11154,8 @@ void tst_QGraphicsItem::QTBUG_12112_focusItem()
|
|||||||
|
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
||||||
|
|
||||||
QVERIFY(item1->focusItem());
|
QVERIFY(item1->focusItem());
|
||||||
QVERIFY(!item2->focusItem());
|
QVERIFY(!item2->focusItem());
|
||||||
@ -11238,7 +11239,7 @@ void tst_QGraphicsItem::QTBUG_16374_crashInDestructor()
|
|||||||
scene.addItem(&win);
|
scene.addItem(&win);
|
||||||
|
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash()
|
void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash()
|
||||||
@ -11258,7 +11259,7 @@ void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash()
|
|||||||
fi->setFocus();
|
fi->setFocus();
|
||||||
|
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
fi->setParentItem(fi2);
|
fi->setParentItem(fi2);
|
||||||
fi->setFocus();
|
fi->setFocus();
|
||||||
|
@ -147,7 +147,7 @@ void tst_QGraphicsLayout::compressLayoutRequest()
|
|||||||
scene.addItem(tw);
|
scene.addItem(tw);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QGraphicsLinearLayout *lout = new QGraphicsLinearLayout(tw);
|
QGraphicsLinearLayout *lout = new QGraphicsLinearLayout(tw);
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
QGraphicsWidget *gw = new QGraphicsWidget(tw);
|
QGraphicsWidget *gw = new QGraphicsWidget(tw);
|
||||||
|
@ -339,7 +339,7 @@ void tst_QGraphicsLinearLayout::alignment()
|
|||||||
widget->resize(newSize);
|
widget->resize(newSize);
|
||||||
view.show();
|
view.show();
|
||||||
widget->show();
|
widget->show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
@ -669,7 +669,7 @@ void tst_QGraphicsLinearLayout::invalidate()
|
|||||||
view.show();
|
view.show();
|
||||||
widget->show();
|
widget->show();
|
||||||
//QTest::qWait(1000);
|
//QTest::qWait(1000);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
layout.layoutRequest = 0;
|
layout.layoutRequest = 0;
|
||||||
|
|
||||||
@ -1158,7 +1158,7 @@ void tst_QGraphicsLinearLayout::testStretch()
|
|||||||
|
|
||||||
//view->setSceneRect(-50, -50, 800, 800);
|
//view->setSceneRect(-50, -50, 800, 800);
|
||||||
//view->show();
|
//view->show();
|
||||||
//QTest::qWaitForWindowShown(view);
|
//QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
//QTest::qWait(5000);
|
//QTest::qWait(5000);
|
||||||
QCOMPARE(form->geometry().size(), QSizeF(600,600));
|
QCOMPARE(form->geometry().size(), QSizeF(600,600));
|
||||||
QCOMPARE(w1->geometry(), QRectF(0, 0, 100, 100));
|
QCOMPARE(w1->geometry(), QRectF(0, 0, 100, 100));
|
||||||
|
@ -1088,8 +1088,8 @@ void tst_QGraphicsProxyWidget::keyPressEvent()
|
|||||||
view.show();
|
view.show();
|
||||||
view.viewport()->setFocus();
|
view.viewport()->setFocus();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
||||||
|
|
||||||
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
||||||
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
||||||
@ -1129,8 +1129,8 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
||||||
|
|
||||||
|
|
||||||
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
||||||
@ -1173,8 +1173,8 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent()
|
|||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
||||||
|
|
||||||
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
||||||
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
||||||
@ -1217,7 +1217,7 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
|
|||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
|
||||||
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
|
||||||
@ -1279,8 +1279,8 @@ void tst_QGraphicsProxyWidget::paintEvent()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_VERIFY(view.isActiveWindow());
|
QVERIFY(view.isActiveWindow());
|
||||||
|
|
||||||
SubQGraphicsProxyWidget proxy;
|
SubQGraphicsProxyWidget proxy;
|
||||||
|
|
||||||
@ -1289,7 +1289,7 @@ void tst_QGraphicsProxyWidget::paintEvent()
|
|||||||
//this bug prevents the widget from being updated
|
//this bug prevents the widget from being updated
|
||||||
|
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTest::qWait(30);
|
QTest::qWait(30);
|
||||||
proxy.setWidget(w);
|
proxy.setWidget(w);
|
||||||
@ -1691,7 +1691,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -1775,7 +1775,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -1908,7 +1908,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -2219,8 +2219,8 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), &window);
|
QCOMPARE(QApplication::activeWindow(), &window);
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -2291,8 +2291,8 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), &window);
|
QCOMPARE(QApplication::activeWindow(), &window);
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -2370,8 +2370,8 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets()
|
|||||||
window.show();
|
window.show();
|
||||||
QApplication::setActiveWindow(&window);
|
QApplication::setActiveWindow(&window);
|
||||||
window.activateWindow();
|
window.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), &window);
|
QCOMPARE(QApplication::activeWindow(), &window);
|
||||||
|
|
||||||
leftDial->setFocus();
|
leftDial->setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
@ -2461,7 +2461,7 @@ void tst_QGraphicsProxyWidget::popup_basic()
|
|||||||
QCOMPARE(box->pos(), QPoint());
|
QCOMPARE(box->pos(), QPoint());
|
||||||
QCOMPARE(proxy->pos(), QPointF());
|
QCOMPARE(proxy->pos(), QPointF());
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(125);
|
QTest::qWait(125);
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
@ -2556,9 +2556,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
|
|||||||
proxy->show();
|
proxy->show();
|
||||||
scene.addItem(proxy);
|
scene.addItem(proxy);
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QApplication::processEvents();
|
QVERIFY(view.isActiveWindow());
|
||||||
QTRY_VERIFY(view.isActiveWindow());
|
|
||||||
|
|
||||||
// in
|
// in
|
||||||
QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
|
QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
|
||||||
@ -2967,7 +2966,7 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie()
|
|||||||
{
|
{
|
||||||
MainWidget *w = new MainWidget();
|
MainWidget *w = new MainWidget();
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
QTest::qWait(100);
|
QTest::qWait(100);
|
||||||
QTest::mouseMove(w->view->viewport(), w->view->mapFromScene(w->widget->mapToScene(w->widget->boundingRect().center())));
|
QTest::mouseMove(w->view->viewport(), w->view->mapFromScene(w->widget->mapToScene(w->widget->boundingRect().center())));
|
||||||
delete w->item;
|
delete w->item;
|
||||||
@ -3120,7 +3119,7 @@ void tst_QGraphicsProxyWidget::actionsContextMenu()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
view.setFocus();
|
view.setFocus();
|
||||||
QTRY_VERIFY(view.hasFocus());
|
QTRY_VERIFY(view.hasFocus());
|
||||||
|
|
||||||
@ -3627,8 +3626,8 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
|
|||||||
view.resize(600, 600);
|
view.resize(600, 600);
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), &view);
|
QCOMPARE(QApplication::activeWindow(), &view);
|
||||||
QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center())));
|
QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center())));
|
||||||
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos()));
|
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos()));
|
||||||
QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true);
|
QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true);
|
||||||
|
@ -3138,8 +3138,8 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems()
|
|||||||
widget.show();
|
widget.show();
|
||||||
qApp->setActiveWindow(&widget);
|
qApp->setActiveWindow(&widget);
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
QTRY_VERIFY(view->hasFocus());
|
QVERIFY(view->hasFocus());
|
||||||
QTRY_VERIFY(scene.isActive());
|
QTRY_VERIFY(scene.isActive());
|
||||||
QVERIFY(view->viewport()->hasFocus());
|
QVERIFY(view->viewport()->hasFocus());
|
||||||
QVERIFY(scene.hasFocus());
|
QVERIFY(scene.hasFocus());
|
||||||
@ -3219,8 +3219,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
|
|||||||
widget.show();
|
widget.show();
|
||||||
qApp->setActiveWindow(&widget);
|
qApp->setActiveWindow(&widget);
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
QApplication::processEvents();
|
|
||||||
|
|
||||||
dial1->setFocus();
|
dial1->setFocus();
|
||||||
QTRY_VERIFY(dial1->hasFocus());
|
QTRY_VERIFY(dial1->hasFocus());
|
||||||
@ -3259,7 +3258,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
|
|||||||
widget.show();
|
widget.show();
|
||||||
qApp->setActiveWindow(&widget);
|
qApp->setActiveWindow(&widget);
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
QTRY_VERIFY(widget1->hasFocus());
|
QTRY_VERIFY(widget1->hasFocus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3303,7 +3302,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
|
|||||||
widget.show();
|
widget.show();
|
||||||
qApp->setActiveWindow(&widget);
|
qApp->setActiveWindow(&widget);
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
|
|
||||||
dial1->setFocus();
|
dial1->setFocus();
|
||||||
QTRY_VERIFY(dial1->hasFocus());
|
QTRY_VERIFY(dial1->hasFocus());
|
||||||
@ -3388,8 +3387,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
|
|||||||
widget.show();
|
widget.show();
|
||||||
qApp->setActiveWindow(&widget);
|
qApp->setActiveWindow(&widget);
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
QApplication::processEvents();
|
|
||||||
QTRY_VERIFY(widget1->hasFocus());
|
QTRY_VERIFY(widget1->hasFocus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4181,8 +4179,8 @@ void tst_QGraphicsScene::isActive()
|
|||||||
|
|
||||||
toplevel3.show();
|
toplevel3.show();
|
||||||
QApplication::setActiveWindow(&toplevel3);
|
QApplication::setActiveWindow(&toplevel3);
|
||||||
QTest::qWaitForWindowShown(&toplevel3);
|
QVERIFY(QTest::qWaitForWindowActive(&toplevel3));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), &toplevel3);
|
QCOMPARE(QApplication::activeWindow(), &toplevel3);
|
||||||
|
|
||||||
QVERIFY(scene1.isActive());
|
QVERIFY(scene1.isActive());
|
||||||
QVERIFY(!scene2.isActive());
|
QVERIFY(!scene2.isActive());
|
||||||
@ -4350,7 +4348,7 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
|
|||||||
proxy->rotate(15);
|
proxy->rotate(15);
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
QTest::qWaitForWindowShown(view);
|
QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
view->repaints = 0;
|
view->repaints = 0;
|
||||||
proxy->update(10, 10, 10, 10);
|
proxy->update(10, 10, 10, 10);
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
@ -4396,7 +4394,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
|
|||||||
backItem->rotate(15);
|
backItem->rotate(15);
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
QTest::qWaitForWindowShown(view);
|
QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
view->repaints = 0;
|
view->repaints = 0;
|
||||||
rectItem->update(10, 10, 10, 10);
|
rectItem->update(10, 10, 10, 10);
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
@ -4438,7 +4436,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
|
|||||||
rectItem->rotate(15);
|
rectItem->rotate(15);
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
QTest::qWaitForWindowShown(view);
|
QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
view->repaints = 0;
|
view->repaints = 0;
|
||||||
rectItem->update(10, 10, 10, 10);
|
rectItem->update(10, 10, 10, 10);
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
@ -4479,7 +4477,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
|
|||||||
rectItem->rotate(15);
|
rectItem->rotate(15);
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
QTest::qWaitForWindowShown(view);
|
QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
view->repaints = 0;
|
view->repaints = 0;
|
||||||
rectItem->update(10, 10, 10, 10);
|
rectItem->update(10, 10, 10, 10);
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
@ -4581,8 +4579,8 @@ void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
|
|||||||
rect->setFlag(QGraphicsItem::ItemIsFocusable);
|
rect->setFlag(QGraphicsItem::ItemIsFocusable);
|
||||||
|
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
|
||||||
QVERIFY(!scene.focusItem());
|
QVERIFY(!scene.focusItem());
|
||||||
|
|
||||||
|
@ -276,9 +276,7 @@ void tst_QGraphicsSceneIndex::removeItems()
|
|||||||
view.resize(600, 600);
|
view.resize(600, 600);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
|
||||||
QApplication::processEvents();
|
|
||||||
|
|
||||||
scene.removeItem(widgetChild1);
|
scene.removeItem(widgetChild1);
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ void tst_QGraphicsView::construction()
|
|||||||
QCOMPARE(view.transformationAnchor(), QGraphicsView::AnchorViewCenter);
|
QCOMPARE(view.transformationAnchor(), QGraphicsView::AnchorViewCenter);
|
||||||
QCOMPARE(view.resizeAnchor(), QGraphicsView::NoAnchor);
|
QCOMPARE(view.resizeAnchor(), QGraphicsView::NoAnchor);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestItem : public QGraphicsItem
|
class TestItem : public QGraphicsItem
|
||||||
@ -357,7 +357,7 @@ void tst_QGraphicsView::renderHints()
|
|||||||
|
|
||||||
QCOMPARE(item->hints, 0);
|
QCOMPARE(item->hints, 0);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
view.repaint();
|
view.repaint();
|
||||||
QTRY_COMPARE(item->hints, view.renderHints());
|
QTRY_COMPARE(item->hints, view.renderHints());
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ void tst_QGraphicsView::alignment()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
for (int j = 0; j < 3; ++j) {
|
for (int j = 0; j < 3; ++j) {
|
||||||
@ -492,7 +492,7 @@ void tst_QGraphicsView::setScene()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(view.sceneRect(), scene.sceneRect());
|
QCOMPARE(view.sceneRect(), scene.sceneRect());
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
|
|||||||
view.setFixedSize(100, 100);
|
view.setFixedSize(100, 100);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
view.setInteractive(j ? false : true);
|
view.setInteractive(j ? false : true);
|
||||||
@ -800,7 +800,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
|
|||||||
|
|
||||||
view.setDragMode(QGraphicsView::RubberBandDrag);
|
view.setDragMode(QGraphicsView::RubberBandDrag);
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
@ -1157,7 +1157,7 @@ void tst_QGraphicsView::centerOnItem()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setSceneRect(-1000, -1000, 2000, 2000);
|
view.setSceneRect(-1000, -1000, 2000, 2000);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
int tolerance = 7;
|
int tolerance = 7;
|
||||||
|
|
||||||
for (int x = 0; x < 3; ++x) {
|
for (int x = 0; x < 3; ++x) {
|
||||||
@ -1209,7 +1209,7 @@ void tst_QGraphicsView::ensureVisibleRect()
|
|||||||
view.setSceneRect(-500, -500, 1000, 1000);
|
view.setSceneRect(-500, -500, 1000, 1000);
|
||||||
view.setFixedSize(250, 250);
|
view.setFixedSize(250, 250);
|
||||||
toplevel.show();
|
toplevel.show();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
|
||||||
|
|
||||||
for (int y = -100; y < 100; y += 25) {
|
for (int y = -100; y < 100; y += 25) {
|
||||||
for (int x = -100; x < 100; x += 13) {
|
for (int x = -100; x < 100; x += 13) {
|
||||||
@ -1404,7 +1404,7 @@ void tst_QGraphicsView::itemsAtPosition()
|
|||||||
view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QPoint screenPos = view.viewport()->mapToGlobal(viewPos);
|
QPoint screenPos = view.viewport()->mapToGlobal(viewPos);
|
||||||
QPointF scenePos = view.mapToScene(viewPos);
|
QPointF scenePos = view.mapToScene(viewPos);
|
||||||
@ -1659,7 +1659,7 @@ void tst_QGraphicsView::itemAt2()
|
|||||||
view.setTransformationAnchor(QGraphicsView::NoAnchor);
|
view.setTransformationAnchor(QGraphicsView::NoAnchor);
|
||||||
view.setRenderHint(QPainter::Antialiasing);
|
view.setRenderHint(QPainter::Antialiasing);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
QPoint itemViewPoint = view.mapFromScene(item->scenePos());
|
QPoint itemViewPoint = view.mapFromScene(item->scenePos());
|
||||||
@ -2018,10 +2018,9 @@ void tst_QGraphicsView::sendEvent()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWait(20);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
|
|
||||||
item->setFocus();
|
item->setFocus();
|
||||||
|
|
||||||
@ -2086,10 +2085,9 @@ void tst_QGraphicsView::wheelEvent()
|
|||||||
// Assign a view.
|
// Assign a view.
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWait(20);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
|
|
||||||
|
|
||||||
// Send a wheel event with horizontal orientation.
|
// Send a wheel event with horizontal orientation.
|
||||||
@ -2130,7 +2128,7 @@ void tst_QGraphicsView::cursor()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setFixedSize(400, 400);
|
view.setFixedSize(400, 400);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
|
QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
|
||||||
view.viewport()->setCursor(Qt::PointingHandCursor);
|
view.viewport()->setCursor(Qt::PointingHandCursor);
|
||||||
@ -2167,7 +2165,7 @@ void tst_QGraphicsView::cursor2()
|
|||||||
view.viewport()->setCursor(Qt::PointingHandCursor);
|
view.viewport()->setCursor(Qt::PointingHandCursor);
|
||||||
view.setFixedSize(400, 400);
|
view.setFixedSize(400, 400);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
sendMouseMove(view.viewport(), view.mapFromScene(-30, -30));
|
sendMouseMove(view.viewport(), view.mapFromScene(-30, -30));
|
||||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
|
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
|
||||||
@ -2268,7 +2266,7 @@ void tst_QGraphicsView::resizeAnchor()
|
|||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
view.resize(100, 100);
|
view.resize(100, 100);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
@ -2420,8 +2418,8 @@ void tst_QGraphicsView::viewportUpdateMode2()
|
|||||||
view.getContentsMargins(&left, &top, &right, &bottom);
|
view.getContentsMargins(&left, &top, &right, &bottom);
|
||||||
view.resize(200 + left + right, 200 + top + bottom);
|
view.resize(200 + left + right, 200 + top + bottom);
|
||||||
toplevel.show();
|
toplevel.show();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
qApp->setActiveWindow(&toplevel);
|
||||||
QTest::qWait(50);
|
QVERIFY(QTest::qWaitForWindowActive(&toplevel));
|
||||||
QTRY_VERIFY(view.painted);
|
QTRY_VERIFY(view.painted);
|
||||||
const QRect viewportRect = view.viewport()->rect();
|
const QRect viewportRect = view.viewport()->rect();
|
||||||
QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
|
QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
|
||||||
@ -2568,7 +2566,7 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
view.viewport()->repaint();
|
view.viewport()->repaint();
|
||||||
|
|
||||||
QVERIFY(!parent->dirtyPainter);
|
QVERIFY(!parent->dirtyPainter);
|
||||||
@ -2586,12 +2584,12 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState()
|
|||||||
|
|
||||||
MyGraphicsView painter(&scene);
|
MyGraphicsView painter(&scene);
|
||||||
painter.show();
|
painter.show();
|
||||||
QTest::qWaitForWindowShown(&painter);
|
QVERIFY(QTest::qWaitForWindowExposed(&painter));
|
||||||
|
|
||||||
MyGraphicsView painter2(&scene);
|
MyGraphicsView painter2(&scene);
|
||||||
painter2.setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
|
painter2.setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
|
||||||
painter2.show();
|
painter2.show();
|
||||||
QTest::qWaitForWindowShown(&painter2);
|
QVERIFY(QTest::qWaitForWindowExposed(&painter2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QGraphicsView::optimizationFlags_dontSavePainterState2_data()
|
void tst_QGraphicsView::optimizationFlags_dontSavePainterState2_data()
|
||||||
@ -2730,7 +2728,7 @@ void tst_QGraphicsView::levelOfDetail()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QTRY_COMPARE(item->lastLod, qreal(1));
|
QTRY_COMPARE(item->lastLod, qreal(1));
|
||||||
|
|
||||||
@ -2823,7 +2821,7 @@ void tst_QGraphicsView::acceptMousePressEvent()
|
|||||||
|
|
||||||
TestView view(&scene);
|
TestView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QMouseEvent event(QEvent::MouseButtonPress,
|
QMouseEvent event(QEvent::MouseButtonPress,
|
||||||
view.viewport()->rect().center(),
|
view.viewport()->rect().center(),
|
||||||
@ -2898,7 +2896,7 @@ void tst_QGraphicsView::itemsUnderMouse()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(view.items(view.mapFromScene(w3.boundingRect().center())).first(),
|
QCOMPARE(view.items(view.mapFromScene(w3.boundingRect().center())).first(),
|
||||||
static_cast<QGraphicsItem *>(&w3));
|
static_cast<QGraphicsItem *>(&w3));
|
||||||
@ -2935,9 +2933,9 @@ void tst_QGraphicsView::task172231_untransformableItems()
|
|||||||
|
|
||||||
view.scale(2, 1);
|
view.scale(2, 1);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
|
|
||||||
QRectF origExposedRect = text->exposedRect;
|
QRectF origExposedRect = text->exposedRect;
|
||||||
|
|
||||||
@ -3042,7 +3040,7 @@ void tst_QGraphicsView::task186827_deleteReplayedItem()
|
|||||||
MouseMoveCounter view;
|
MouseMoveCounter view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
view.viewport()->setMouseTracking(true);
|
view.viewport()->setMouseTracking(true);
|
||||||
|
|
||||||
QCOMPARE(view.mouseMoves, 0);
|
QCOMPARE(view.mouseMoves, 0);
|
||||||
@ -3076,10 +3074,10 @@ void tst_QGraphicsView::task207546_focusCrash()
|
|||||||
widget.layout()->addWidget(gr1);
|
widget.layout()->addWidget(gr1);
|
||||||
widget.layout()->addWidget(gr2);
|
widget.layout()->addWidget(gr2);
|
||||||
widget.show();
|
widget.show();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
|
||||||
widget.activateWindow();
|
widget.activateWindow();
|
||||||
QApplication::setActiveWindow(&widget);
|
QApplication::setActiveWindow(&widget);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&widget));
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&widget));
|
||||||
widget.focusNextPrevChild(true);
|
widget.focusNextPrevChild(true);
|
||||||
QCOMPARE(static_cast<QWidget *>(gr2), widget.focusWidget());
|
QCOMPARE(static_cast<QWidget *>(gr2), widget.focusWidget());
|
||||||
}
|
}
|
||||||
@ -3219,7 +3217,7 @@ void tst_QGraphicsView::task245469_itemsAtPointWithClip()
|
|||||||
view.resize(150,150);
|
view.resize(150,150);
|
||||||
view.rotate(90);
|
view.rotate(90);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QList<QGraphicsItem *> itemsAtCenter = view.items(view.viewport()->rect().center());
|
QList<QGraphicsItem *> itemsAtCenter = view.items(view.viewport()->rect().center());
|
||||||
QCOMPARE(itemsAtCenter, (QList<QGraphicsItem *>() << child << parent));
|
QCOMPARE(itemsAtCenter, (QList<QGraphicsItem *>() << child << parent));
|
||||||
@ -3338,7 +3336,7 @@ void tst_QGraphicsView::scrollAfterResize()
|
|||||||
view.setSceneRect(-1000, -1000, 2000, 2000);
|
view.setSceneRect(-1000, -1000, 2000, 2000);
|
||||||
view.resize(300, 300);
|
view.resize(300, 300);
|
||||||
toplevel.show();
|
toplevel.show();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
|
||||||
view.horizontalScrollBar()->setValue(0);
|
view.horizontalScrollBar()->setValue(0);
|
||||||
view.verticalScrollBar()->setValue(0);
|
view.verticalScrollBar()->setValue(0);
|
||||||
QCOMPARE(view.viewportTransform(), x1);
|
QCOMPARE(view.viewportTransform(), x1);
|
||||||
@ -3408,7 +3406,7 @@ void tst_QGraphicsView::moveItemWhileScrolling()
|
|||||||
view.show();
|
view.show();
|
||||||
if (changedConnected)
|
if (changedConnected)
|
||||||
QObject::connect(view.scene(), SIGNAL(changed(QList<QRectF>)), this, SLOT(dummySlot()));
|
QObject::connect(view.scene(), SIGNAL(changed(QList<QRectF>)), this, SLOT(dummySlot()));
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_VERIFY(view.painted);
|
QTRY_VERIFY(view.painted);
|
||||||
view.painted = false;
|
view.painted = false;
|
||||||
@ -3445,7 +3443,7 @@ void tst_QGraphicsView::centerOnDirtyItem()
|
|||||||
view.centerOn(item);
|
view.centerOn(item);
|
||||||
|
|
||||||
toplevel.show();
|
toplevel.show();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
|
|
||||||
QImage before(view.viewport()->size(), QImage::Format_ARGB32);
|
QImage before(view.viewport()->size(), QImage::Format_ARGB32);
|
||||||
@ -3575,7 +3573,7 @@ void tst_QGraphicsView::mouseTracking2()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QVERIFY(!view.viewport()->hasMouseTracking());
|
QVERIFY(!view.viewport()->hasMouseTracking());
|
||||||
view.viewport()->setMouseTracking(true); // Explicitly enable mouse tracking.
|
view.viewport()->setMouseTracking(true); // Explicitly enable mouse tracking.
|
||||||
@ -3711,7 +3709,7 @@ void tst_QGraphicsView::render()
|
|||||||
view.resize(200, 200);
|
view.resize(200, 200);
|
||||||
view.painted = false;
|
view.painted = false;
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_VERIFY(view.painted);
|
QTRY_VERIFY(view.painted);
|
||||||
|
|
||||||
@ -3824,7 +3822,7 @@ void tst_QGraphicsView::update()
|
|||||||
view.getContentsMargins(&left, &top, &right, &bottom);
|
view.getContentsMargins(&left, &top, &right, &bottom);
|
||||||
view.resize(200 + left + right, 200 + top + bottom);
|
view.resize(200 + left + right, 200 + top + bottom);
|
||||||
toplevel.show();
|
toplevel.show();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
|
||||||
|
|
||||||
|
|
||||||
QApplication::setActiveWindow(&toplevel);
|
QApplication::setActiveWindow(&toplevel);
|
||||||
@ -4091,9 +4089,9 @@ void tst_QGraphicsView::inputMethodSensitivity()
|
|||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
|
||||||
|
|
||||||
FocusItem *item = new FocusItem;
|
FocusItem *item = new FocusItem;
|
||||||
|
|
||||||
@ -4247,7 +4245,7 @@ void tst_QGraphicsView::indirectPainting()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTest::qWait(100);
|
QTest::qWait(100);
|
||||||
|
|
||||||
scene.drawCount = 0;
|
scene.drawCount = 0;
|
||||||
@ -4274,7 +4272,7 @@ void tst_QGraphicsView::compositionModeInDrawBackground()
|
|||||||
QGraphicsScene dummy;
|
QGraphicsScene dummy;
|
||||||
MyView view(&dummy);
|
MyView view(&dummy);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
// Make sure the painter's composition mode is SourceOver in drawBackground.
|
// Make sure the painter's composition mode is SourceOver in drawBackground.
|
||||||
QTRY_VERIFY(view.painted);
|
QTRY_VERIFY(view.painted);
|
||||||
@ -4399,7 +4397,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
|
|||||||
|
|
||||||
SAGraphicsView view(&scene);
|
SAGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
int hsbValue = view.horizontalScrollBar()->value();
|
int hsbValue = view.horizontalScrollBar()->value();
|
||||||
view.horizontalScrollBar()->setValue(hsbValue / 2);
|
view.horizontalScrollBar()->setValue(hsbValue / 2);
|
||||||
@ -4456,10 +4454,9 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
|
|||||||
view.setFrameStyle(0);
|
view.setFrameStyle(0);
|
||||||
view.resize(75, 75);
|
view.resize(75, 75);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
|
||||||
view.activateWindow();
|
view.activateWindow();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
|
||||||
|
|
||||||
QCOMPARE(view.items(view.rect()).size(), numItems);
|
QCOMPARE(view.items(view.rect()).size(), numItems);
|
||||||
}
|
}
|
||||||
@ -4518,7 +4515,7 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setFixedSize(400, 400);
|
view.setFixedSize(400, 400);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
|
QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
|
||||||
view.viewport()->setCursor(Qt::PointingHandCursor);
|
view.viewport()->setCursor(Qt::PointingHandCursor);
|
||||||
|
@ -680,7 +680,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveToChildren()
|
|||||||
QGraphicsView view;
|
QGraphicsView view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||||
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
||||||
@ -715,7 +715,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveToGrandChildren()
|
|||||||
QGraphicsView view;
|
QGraphicsView view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||||
@ -751,7 +751,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveViaNonWidget()
|
|||||||
QGraphicsView view;
|
QGraphicsView view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||||
@ -787,7 +787,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveFromScene()
|
|||||||
QGraphicsView view;
|
QGraphicsView view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||||
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
||||||
@ -835,7 +835,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveInParentChange()
|
|||||||
QGraphicsView view;
|
QGraphicsView view;
|
||||||
view.setScene(&scene);
|
view.setScene(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QVERIFY(grandChild1->font().italic());
|
QVERIFY(grandChild1->font().italic());
|
||||||
QVERIFY(!grandChild1->font().bold());
|
QVERIFY(!grandChild1->font().bold());
|
||||||
@ -1228,7 +1228,7 @@ void tst_QGraphicsWidget::layoutDirection()
|
|||||||
widget.setLayoutDirection(layoutDirection);
|
widget.setLayoutDirection(layoutDirection);
|
||||||
QCOMPARE(widget.testAttribute(Qt::WA_SetLayoutDirection), true);
|
QCOMPARE(widget.testAttribute(Qt::WA_SetLayoutDirection), true);
|
||||||
view->show();
|
view->show();
|
||||||
QTest::qWaitForWindowShown(view);
|
QVERIFY(QTest::qWaitForWindowExposed(view));
|
||||||
for (int i = 0; i < children.count(); ++i) {
|
for (int i = 0; i < children.count(); ++i) {
|
||||||
QTRY_COMPARE(children[i]->layoutDirection(), layoutDirection);
|
QTRY_COMPARE(children[i]->layoutDirection(), layoutDirection);
|
||||||
QTRY_COMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
|
QTRY_COMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
|
||||||
@ -1501,8 +1501,8 @@ void tst_QGraphicsWidget::setTabOrderAndReparent()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QApplication::setActiveWindow(&view);
|
QApplication::setActiveWindow(&view);
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowActive(&view));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
QGraphicsWidget *w1, *w2, *w3, *w4;
|
QGraphicsWidget *w1, *w2, *w3, *w4;
|
||||||
@ -2623,7 +2623,7 @@ void tst_QGraphicsWidget::painterStateProtectionOnWindowFrame()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
scene.addItem(widget);
|
scene.addItem(widget);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProxyStyle : public QCommonStyle
|
class ProxyStyle : public QCommonStyle
|
||||||
@ -2827,7 +2827,7 @@ void tst_QGraphicsWidget::ensureClipping()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
QList<QGraphicsItem *> expected;
|
QList<QGraphicsItem *> expected;
|
||||||
expected << clipWidget << childWidget << childitem;
|
expected << clipWidget << childWidget << childitem;
|
||||||
@ -3033,7 +3033,7 @@ void tst_QGraphicsWidget::addChildInpolishEvent()
|
|||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.resize(200, 200);
|
view.resize(200, 200);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QTRY_COMPARE(PolishWidget::numberOfPolish, 2);
|
QTRY_COMPARE(PolishWidget::numberOfPolish, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3055,7 +3055,7 @@ void tst_QGraphicsWidget::polishEvent()
|
|||||||
|
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
// Make sure the item is painted.
|
// Make sure the item is painted.
|
||||||
QTRY_VERIFY(widget->events.contains(QEvent::Paint));
|
QTRY_VERIFY(widget->events.contains(QEvent::Paint));
|
||||||
@ -3233,7 +3233,7 @@ void tst_QGraphicsWidget::itemChangeEvents()
|
|||||||
QGraphicsWidget *parent = new QGraphicsWidget;
|
QGraphicsWidget *parent = new QGraphicsWidget;
|
||||||
scene.addItem(parent);
|
scene.addItem(parent);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
|
||||||
TestGraphicsWidget *item = new TestGraphicsWidget;
|
TestGraphicsWidget *item = new TestGraphicsWidget;
|
||||||
item->setParentItem(parent);
|
item->setParentItem(parent);
|
||||||
@ -3275,7 +3275,7 @@ void tst_QGraphicsWidget::itemSendGeometryPosChangesDeactivated()
|
|||||||
QGraphicsWidget *item = new QGraphicsWidget;
|
QGraphicsWidget *item = new QGraphicsWidget;
|
||||||
scene.addItem(item);
|
scene.addItem(item);
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowShown(&view);
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
item->setGeometry(QRectF(0, 0, 50, 50));
|
item->setGeometry(QRectF(0, 0, 50, 50));
|
||||||
QTRY_COMPARE(item->geometry(), QRectF(0, 0, 50, 50));
|
QTRY_COMPARE(item->geometry(), QRectF(0, 0, 50, 50));
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ public:
|
|||||||
messageBox->setDefaultButton(QMessageBox::Save);
|
messageBox->setDefaultButton(QMessageBox::Save);
|
||||||
|
|
||||||
messageBox->show();
|
messageBox->show();
|
||||||
QTest::qWaitForWindowShown(messageBox);
|
QVERIFY(QTest::qWaitForWindowExposed(messageBox));
|
||||||
|
|
||||||
// verify that all windows are visible
|
// verify that all windows are visible
|
||||||
foreach (QWidget *w, qApp->topLevelWidgets())
|
foreach (QWidget *w, qApp->topLevelWidgets())
|
||||||
@ -797,7 +797,7 @@ void tst_QApplication::closeAllWindows()
|
|||||||
// show all windows
|
// show all windows
|
||||||
foreach (QWidget *w, app.topLevelWidgets()) {
|
foreach (QWidget *w, app.topLevelWidgets()) {
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
}
|
}
|
||||||
// verify that they are visible
|
// verify that they are visible
|
||||||
foreach (QWidget *w, app.topLevelWidgets())
|
foreach (QWidget *w, app.topLevelWidgets())
|
||||||
@ -815,7 +815,7 @@ void tst_QApplication::closeAllWindows()
|
|||||||
// show all windows
|
// show all windows
|
||||||
foreach (QWidget *w, app.topLevelWidgets()) {
|
foreach (QWidget *w, app.topLevelWidgets()) {
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
}
|
}
|
||||||
// close the last window to open the prompt (eventloop recurses)
|
// close the last window to open the prompt (eventloop recurses)
|
||||||
promptOnCloseWidget->close();
|
promptOnCloseWidget->close();
|
||||||
@ -1917,7 +1917,7 @@ void tst_QApplication::touchEventPropagation()
|
|||||||
window.show(); // Must have an explicitly specified QWindow for handleTouchEvent,
|
window.show(); // Must have an explicitly specified QWindow for handleTouchEvent,
|
||||||
// passing 0 would result in using topLevelAt() which is not ok in this case
|
// passing 0 would result in using topLevelAt() which is not ok in this case
|
||||||
// as the screen position in the point is bogus.
|
// as the screen position in the point is bogus.
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowExposed(&window));
|
||||||
// QPA always takes screen positions and since we map the TouchPoint back to QPA's structure first,
|
// QPA always takes screen positions and since we map the TouchPoint back to QPA's structure first,
|
||||||
// we must ensure there is a screen position in the TouchPoint that maps to a local 0, 0.
|
// we must ensure there is a screen position in the TouchPoint that maps to a local 0, 0.
|
||||||
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
||||||
@ -1971,7 +1971,7 @@ void tst_QApplication::touchEventPropagation()
|
|||||||
TouchEventPropagationTestWidget widget(&window);
|
TouchEventPropagationTestWidget widget(&window);
|
||||||
widget.setObjectName("2. widget");
|
widget.setObjectName("2. widget");
|
||||||
window.show();
|
window.show();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowExposed(&window));
|
||||||
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
||||||
releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
|
|||||||
QWidget widget;
|
QWidget widget;
|
||||||
widget.setLayout(layout);
|
widget.setLayout(layout);
|
||||||
widget.show();
|
widget.show();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||||
|
|
||||||
int height = label->height();
|
int height = label->height();
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void tst_QDesktopWidget::screenNumberForQWidget()
|
|||||||
|
|
||||||
QWidget widget;
|
QWidget widget;
|
||||||
widget.show();
|
widget.show();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||||
QVERIFY(widget.isVisible());
|
QVERIFY(widget.isVisible());
|
||||||
|
|
||||||
int widgetScreen = desktop.screenNumber(&widget);
|
int widgetScreen = desktop.screenNumber(&widget);
|
||||||
@ -169,7 +169,7 @@ void tst_QDesktopWidget::screenGeometry()
|
|||||||
QVERIFY(r.isNull());
|
QVERIFY(r.isNull());
|
||||||
QWidget widget;
|
QWidget widget;
|
||||||
widget.show();
|
widget.show();
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||||
r = desktopWidget->screenGeometry(&widget);
|
r = desktopWidget->screenGeometry(&widget);
|
||||||
|
|
||||||
QRect total;
|
QRect total;
|
||||||
|
@ -704,7 +704,7 @@ void tst_QGridLayout::spacingsAndMargins()
|
|||||||
toplevel.show();
|
toplevel.show();
|
||||||
toplevel.adjustSize();
|
toplevel.adjustSize();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTest::qWaitForWindowShown(&toplevel);
|
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
|
||||||
|
|
||||||
QSize topsize = toplevel.size();
|
QSize topsize = toplevel.size();
|
||||||
QSize minimumsize = vbox.totalMinimumSize();
|
QSize minimumsize = vbox.totalMinimumSize();
|
||||||
|
@ -216,9 +216,8 @@ void tst_QShortcut::initTestCase()
|
|||||||
mainW->setFixedSize( 100, 100 );
|
mainW->setFixedSize( 100, 100 );
|
||||||
mainW->setCentralWidget( edit );
|
mainW->setCentralWidget( edit );
|
||||||
mainW->show();
|
mainW->show();
|
||||||
QTest::qWaitForWindowShown(mainW);
|
|
||||||
mainW->activateWindow();
|
mainW->activateWindow();
|
||||||
QTest::qWait(100);
|
QVERIFY(QTest::qWaitForWindowActive(mainW));
|
||||||
connect( mainW->statusBar(), SIGNAL(messageChanged(const QString&)),
|
connect( mainW->statusBar(), SIGNAL(messageChanged(const QString&)),
|
||||||
this, SLOT(statusMessage(const QString&)) );
|
this, SLOT(statusMessage(const QString&)) );
|
||||||
}
|
}
|
||||||
|
@ -349,12 +349,10 @@ void tst_QStackedLayout::keepFocusAfterSetCurrent()
|
|||||||
|
|
||||||
testWidget->show();
|
testWidget->show();
|
||||||
QApplication::setActiveWindow(testWidget);
|
QApplication::setActiveWindow(testWidget);
|
||||||
QTest::qWaitForWindowShown(testWidget);
|
QVERIFY(QTest::qWaitForWindowActive(testWidget));
|
||||||
QApplication::processEvents();
|
|
||||||
|
|
||||||
edit1->setFocus();
|
edit1->setFocus();
|
||||||
edit1->activateWindow();
|
edit1->activateWindow();
|
||||||
QTest::qWait(25);
|
|
||||||
|
|
||||||
QTRY_VERIFY(edit1->hasFocus());
|
QTRY_VERIFY(edit1->hasFocus());
|
||||||
|
|
||||||
|
@ -106,9 +106,7 @@ void tst_QToolTip::task183679()
|
|||||||
Widget_task183679 widget;
|
Widget_task183679 widget;
|
||||||
widget.show();
|
widget.show();
|
||||||
QApplication::setActiveWindow(&widget);
|
QApplication::setActiveWindow(&widget);
|
||||||
QTest::qWaitForWindowShown(&widget);
|
QVERIFY(QTest::qWaitForWindowActive(&widget));
|
||||||
QTest::qWait(30);
|
|
||||||
|
|
||||||
|
|
||||||
widget.showDelayedToolTip(100);
|
widget.showDelayedToolTip(100);
|
||||||
QTest::qWait(300);
|
QTest::qWait(300);
|
||||||
|
@ -292,7 +292,7 @@ void tst_QWidget_window::tst_showWithoutActivating()
|
|||||||
#else
|
#else
|
||||||
QWidget w;
|
QWidget w;
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
QApplication::clipboard();
|
QApplication::clipboard();
|
||||||
@ -321,7 +321,7 @@ void tst_QWidget_window::tst_paintEventOnSecondShow()
|
|||||||
|
|
||||||
w.reset();
|
w.reset();
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_VERIFY(w.paintEventReceived);
|
QTRY_VERIFY(w.paintEventReceived);
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ void tst_QButtonGroup::arrowKeyNavigation()
|
|||||||
|
|
||||||
dlg.show();
|
dlg.show();
|
||||||
qApp->setActiveWindow(&dlg);
|
qApp->setActiveWindow(&dlg);
|
||||||
QTest::qWaitForWindowShown(&dlg);
|
QVERIFY(QTest::qWaitForWindowActive(&dlg));
|
||||||
|
|
||||||
bt1.setFocus();
|
bt1.setFocus();
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ void tst_QButtonGroup::task106609()
|
|||||||
buttons->addButton(radio3, 3);
|
buttons->addButton(radio3, 3);
|
||||||
vbox->addWidget(radio3);
|
vbox->addWidget(radio3);
|
||||||
dlg.show();
|
dlg.show();
|
||||||
QTest::qWaitForWindowShown(&dlg);
|
QVERIFY(QTest::qWaitForWindowExposed(&dlg));
|
||||||
|
|
||||||
qRegisterMetaType<QAbstractButton*>("QAbstractButton*");
|
qRegisterMetaType<QAbstractButton*>("QAbstractButton*");
|
||||||
QSignalSpy spy1(buttons, SIGNAL(buttonClicked(QAbstractButton*)));
|
QSignalSpy spy1(buttons, SIGNAL(buttonClicked(QAbstractButton*)));
|
||||||
|
@ -177,8 +177,8 @@ void tst_QCalendarWidget::buttonClickCheck()
|
|||||||
QSize size = object.sizeHint();
|
QSize size = object.sizeHint();
|
||||||
object.setGeometry(0,0,size.width(), size.height());
|
object.setGeometry(0,0,size.width(), size.height());
|
||||||
object.show();
|
object.show();
|
||||||
QTest::qWaitForWindowShown(&object);
|
|
||||||
object.activateWindow();
|
object.activateWindow();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&object));
|
||||||
|
|
||||||
QDate selectedDate(2005, 1, 1);
|
QDate selectedDate(2005, 1, 1);
|
||||||
//click on the month buttons
|
//click on the month buttons
|
||||||
@ -332,7 +332,7 @@ void tst_QCalendarWidget::showPrevNext()
|
|||||||
|
|
||||||
QCalendarWidget calWidget;
|
QCalendarWidget calWidget;
|
||||||
calWidget.show();
|
calWidget.show();
|
||||||
QTest::qWaitForWindowShown(&calWidget);
|
QVERIFY(QTest::qWaitForWindowExposed(&calWidget));
|
||||||
if(!dateOrigin.isNull()) {
|
if(!dateOrigin.isNull()) {
|
||||||
calWidget.setSelectedDate(dateOrigin);
|
calWidget.setSelectedDate(dateOrigin);
|
||||||
calWidget.setCurrentPage(dateOrigin.year(), dateOrigin.month());
|
calWidget.setCurrentPage(dateOrigin.year(), dateOrigin.month());
|
||||||
|
@ -1977,7 +1977,7 @@ void tst_QComboBox::task190351_layout()
|
|||||||
list->addItem(QLatin1String("list") + QString::number(i));
|
list->addItem(QLatin1String("list") + QString::number(i));
|
||||||
|
|
||||||
listCombo.show();
|
listCombo.show();
|
||||||
QTest::qWaitForWindowShown(&listCombo);
|
QVERIFY(QTest::qWaitForWindowExposed(&listCombo));
|
||||||
QTRY_VERIFY(listCombo.isVisible());
|
QTRY_VERIFY(listCombo.isVisible());
|
||||||
listCombo.setCurrentIndex(70);
|
listCombo.setCurrentIndex(70);
|
||||||
listCombo.showPopup();
|
listCombo.showPopup();
|
||||||
@ -2116,7 +2116,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
|
|||||||
comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4));
|
comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4));
|
||||||
|
|
||||||
comboBox.show();
|
comboBox.show();
|
||||||
QTest::qWaitForWindowShown(&comboBox);
|
QVERIFY(QTest::qWaitForWindowExposed(&comboBox));
|
||||||
QTRY_VERIFY(comboBox.isVisible());
|
QTRY_VERIFY(comboBox.isVisible());
|
||||||
comboBox.showPopup();
|
comboBox.showPopup();
|
||||||
QTRY_VERIFY(comboBox.view());
|
QTRY_VERIFY(comboBox.view());
|
||||||
@ -2436,8 +2436,8 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
|
|||||||
combo.addItem( QString::number(i));
|
combo.addItem( QString::number(i));
|
||||||
combo.show();
|
combo.show();
|
||||||
QApplication::setActiveWindow(&combo);
|
QApplication::setActiveWindow(&combo);
|
||||||
QTest::qWaitForWindowShown(&combo);
|
QVERIFY(QTest::qWaitForWindowActive(&combo));
|
||||||
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
|
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
|
||||||
|
|
||||||
QCOMPARE(combo.currentText(), QLatin1String("0"));
|
QCOMPARE(combo.currentText(), QLatin1String("0"));
|
||||||
|
|
||||||
@ -2502,7 +2502,7 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated()
|
|||||||
|
|
||||||
w.show();
|
w.show();
|
||||||
QApplication::setActiveWindow(&w);
|
QApplication::setActiveWindow(&w);
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowActive(&w));
|
||||||
cb.clearEditText();
|
cb.clearEditText();
|
||||||
cb.setFocus();
|
cb.setFocus();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
@ -584,7 +584,7 @@ void tst_QCommandLinkButton::heightForWithWithIcon()
|
|||||||
layout->addStretch();
|
layout->addStretch();
|
||||||
mainWin.setLayout(layout);
|
mainWin.setLayout(layout);
|
||||||
mainWin.showMaximized();
|
mainWin.showMaximized();
|
||||||
QTest::qWaitForWindowShown(&mainWin);
|
QVERIFY(QTest::qWaitForWindowExposed(&mainWin));
|
||||||
QVERIFY(largeIconButton->height() > 68); //enough room for the icon
|
QVERIFY(largeIconButton->height() > 68); //enough room for the icon
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -825,7 +825,7 @@ void tst_QDockWidget::taskQTBUG_1665_closableChanged()
|
|||||||
{
|
{
|
||||||
QDockWidget dock;
|
QDockWidget dock;
|
||||||
dock.show();
|
dock.show();
|
||||||
QTest::qWaitForWindowShown(&dock);
|
QVERIFY(QTest::qWaitForWindowExposed(&dock));
|
||||||
|
|
||||||
QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(dock.layout());
|
QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(dock.layout());
|
||||||
|
|
||||||
@ -850,10 +850,10 @@ void tst_QDockWidget::taskQTBUG_9758_undockedGeometry()
|
|||||||
dock1.hide();
|
dock1.hide();
|
||||||
dock2.hide();
|
dock2.hide();
|
||||||
window.show();
|
window.show();
|
||||||
QTest::qWaitForWindowShown(&window);
|
QVERIFY(QTest::qWaitForWindowExposed(&window));
|
||||||
dock1.setFloating(true);
|
dock1.setFloating(true);
|
||||||
dock1.show();
|
dock1.show();
|
||||||
QTest::qWaitForWindowShown(&dock1);
|
QVERIFY(QTest::qWaitForWindowExposed(&dock1));
|
||||||
|
|
||||||
QVERIFY(dock1.x() >= 0);
|
QVERIFY(dock1.x() >= 0);
|
||||||
QVERIFY(dock1.y() >= 0);
|
QVERIFY(dock1.y() >= 0);
|
||||||
|
@ -403,7 +403,7 @@ void tst_QLabel::task226479_movieResize()
|
|||||||
label.show();
|
label.show();
|
||||||
QMovie *movie = new QMovie( &label );
|
QMovie *movie = new QMovie( &label );
|
||||||
label.setMovie(movie);
|
label.setMovie(movie);
|
||||||
QTest::qWaitForWindowShown(&label);
|
QVERIFY(QTest::qWaitForWindowExposed(&label));
|
||||||
movie->setFileName(QFINDTESTDATA("red.png"));
|
movie->setFileName(QFINDTESTDATA("red.png"));
|
||||||
movie->start();
|
movie->start();
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
@ -478,7 +478,7 @@ void tst_QLabel::unicodeText()
|
|||||||
layout->setMargin(8);
|
layout->setMargin(8);
|
||||||
frame.setLayout(layout);
|
frame.setLayout(layout);
|
||||||
frame.show();
|
frame.show();
|
||||||
QTest::qWaitForWindowShown(&frame);
|
QVERIFY(QTest::qWaitForWindowExposed(&frame));
|
||||||
QVERIFY(frame.isVisible()); // was successfully sized and shown
|
QVERIFY(frame.isVisible()); // was successfully sized and shown
|
||||||
testWidget->show();
|
testWidget->show();
|
||||||
}
|
}
|
||||||
@ -519,7 +519,7 @@ void tst_QLabel::mnemonic()
|
|||||||
hbox->addWidget(new QLineEdit);
|
hbox->addWidget(new QLineEdit);
|
||||||
w.setLayout(hbox);
|
w.setLayout(hbox);
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||||
|
|
||||||
QLabelPrivate *d = static_cast<QLabelPrivate *>(QObjectPrivate::get(lab));
|
QLabelPrivate *d = static_cast<QLabelPrivate *>(QObjectPrivate::get(lab));
|
||||||
QVERIFY(d->control);
|
QVERIFY(d->control);
|
||||||
@ -555,7 +555,7 @@ void tst_QLabel::taskQTBUG_7902_contextMenuCrash()
|
|||||||
QLabel *w = new QLabel("Test or crash?");
|
QLabel *w = new QLabel("Test or crash?");
|
||||||
w->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
w->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
|
|
||||||
QTimer ti;
|
QTimer ti;
|
||||||
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
||||||
|
@ -368,7 +368,7 @@ void tst_QLineEdit::initTestCase()
|
|||||||
|
|
||||||
testWidget->resize(200,50);
|
testWidget->resize(200,50);
|
||||||
testWidget->show();
|
testWidget->show();
|
||||||
QTest::qWaitForWindowShown(testWidget);
|
QVERIFY(QTest::qWaitForWindowExposed(testWidget));
|
||||||
QApplication::setActiveWindow(testWidget);
|
QApplication::setActiveWindow(testWidget);
|
||||||
QTRY_VERIFY(testWidget->hasFocus());
|
QTRY_VERIFY(testWidget->hasFocus());
|
||||||
|
|
||||||
@ -3362,7 +3362,7 @@ void tst_QLineEdit::task174640_editingFinished()
|
|||||||
testMenu1->addAction("foo");
|
testMenu1->addAction("foo");
|
||||||
testMenu1->addAction("bar");
|
testMenu1->addAction("bar");
|
||||||
testMenu1->show();
|
testMenu1->show();
|
||||||
QTest::qWaitForWindowShown(testMenu1);
|
QVERIFY(QTest::qWaitForWindowExposed(testMenu1));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
mw.activateWindow();
|
mw.activateWindow();
|
||||||
|
|
||||||
@ -3374,7 +3374,7 @@ void tst_QLineEdit::task174640_editingFinished()
|
|||||||
testMenu2->addAction("foo2");
|
testMenu2->addAction("foo2");
|
||||||
testMenu2->addAction("bar2");
|
testMenu2->addAction("bar2");
|
||||||
testMenu2->show();
|
testMenu2->show();
|
||||||
QTest::qWaitForWindowShown(testMenu2);
|
QVERIFY(QTest::qWaitForWindowExposed(testMenu2));
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
mw.activateWindow();
|
mw.activateWindow();
|
||||||
delete testMenu2;
|
delete testMenu2;
|
||||||
@ -3431,8 +3431,8 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion()
|
|||||||
completer.setCompletionMode(QCompleter::InlineCompletion);
|
completer.setCompletionMode(QCompleter::InlineCompletion);
|
||||||
lineEdit.setCompleter(&completer);
|
lineEdit.setCompleter(&completer);
|
||||||
lineEdit.show();
|
lineEdit.show();
|
||||||
QTest::qWaitForWindowShown(&lineEdit);
|
|
||||||
QApplication::setActiveWindow(&lineEdit);
|
QApplication::setActiveWindow(&lineEdit);
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&lineEdit));
|
||||||
lineEdit.setFocus();
|
lineEdit.setFocus();
|
||||||
QTRY_VERIFY(lineEdit.hasFocus());
|
QTRY_VERIFY(lineEdit.hasFocus());
|
||||||
QTest::keyPress(&lineEdit, 'a');
|
QTest::keyPress(&lineEdit, 'a');
|
||||||
@ -3616,7 +3616,7 @@ void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash()
|
|||||||
// Would pass before the associated commit, but left as a guard.
|
// Would pass before the associated commit, but left as a guard.
|
||||||
QLineEdit *w = new QLineEdit;
|
QLineEdit *w = new QLineEdit;
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
|
|
||||||
QTimer ti;
|
QTimer ti;
|
||||||
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
||||||
@ -3667,7 +3667,7 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
|
|||||||
|
|
||||||
le.show();
|
le.show();
|
||||||
QApplication::setActiveWindow(&le);
|
QApplication::setActiveWindow(&le);
|
||||||
QTest::qWaitForWindowShown(&le);
|
QVERIFY(QTest::qWaitForWindowActive(&le));
|
||||||
le.setFocus();
|
le.setFocus();
|
||||||
QTRY_VERIFY(le.hasFocus());
|
QTRY_VERIFY(le.hasFocus());
|
||||||
le.selectAll();
|
le.selectAll();
|
||||||
@ -3685,7 +3685,7 @@ void tst_QLineEdit::QTBUG13520_textNotVisible()
|
|||||||
LineEdit le;
|
LineEdit le;
|
||||||
le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
|
le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
|
||||||
le.show();
|
le.show();
|
||||||
QTest::qWaitForWindowShown(&le);
|
QVERIFY(QTest::qWaitForWindowExposed(&le));
|
||||||
le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
|
le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
|
||||||
le.setCursorPosition(0);
|
le.setCursorPosition(0);
|
||||||
QTest::qWait(100); //just make sure we get he lineedit correcly painted
|
QTest::qWait(100); //just make sure we get he lineedit correcly painted
|
||||||
@ -3714,7 +3714,7 @@ void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink()
|
|||||||
edit.setText(QLatin1String("AAAA"));
|
edit.setText(QLatin1String("AAAA"));
|
||||||
edit.show();
|
edit.show();
|
||||||
QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
|
QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
|
||||||
QTest::qWaitForWindowShown(&edit);
|
QVERIFY(QTest::qWaitForWindowExposed(&edit));
|
||||||
edit.updateRegion = QRegion();
|
edit.updateRegion = QRegion();
|
||||||
QTest::qWait(QApplication::cursorFlashTime());
|
QTest::qWait(QApplication::cursorFlashTime());
|
||||||
QVERIFY(edit.updateRegion.contains(cursorRect));
|
QVERIFY(edit.updateRegion.contains(cursorRect));
|
||||||
|
@ -1684,7 +1684,7 @@ void tst_QMainWindow::QTBUG2774_stylechange()
|
|||||||
mw.setCentralWidget(central);
|
mw.setCentralWidget(central);
|
||||||
dockw->resize(10,10);
|
dockw->resize(10,10);
|
||||||
mw.show();
|
mw.show();
|
||||||
QTest::qWaitForWindowShown(&mw);
|
QVERIFY(QTest::qWaitForWindowExposed(&mw));
|
||||||
int centralOriginalWidth = central->width();
|
int centralOriginalWidth = central->width();
|
||||||
|
|
||||||
QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() - 3)));
|
QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() - 3)));
|
||||||
|
@ -636,7 +636,7 @@ void tst_QMdiArea::changeWindowTitle()
|
|||||||
mw->setCentralWidget( ws );
|
mw->setCentralWidget( ws );
|
||||||
mw->menuBar();
|
mw->menuBar();
|
||||||
mw->show();
|
mw->show();
|
||||||
QTest::qWaitForWindowShown(mw);
|
QVERIFY(QTest::qWaitForWindowExposed(mw));
|
||||||
|
|
||||||
QWidget *widget = new QWidget( ws );
|
QWidget *widget = new QWidget( ws );
|
||||||
widget->setWindowTitle( wc );
|
widget->setWindowTitle( wc );
|
||||||
@ -656,8 +656,7 @@ void tst_QMdiArea::changeWindowTitle()
|
|||||||
mw->hide();
|
mw->hide();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
mw->show();
|
mw->show();
|
||||||
qApp->processEvents();
|
QVERIFY(QTest::qWaitForWindowExposed(mw));
|
||||||
QTest::qWaitForWindowShown(mw);
|
|
||||||
|
|
||||||
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
|
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
|
||||||
QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
|
QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
|
||||||
|
@ -985,7 +985,7 @@ void tst_QMdiSubWindow::setSystemMenu()
|
|||||||
mainWindow.setCentralWidget(mdiArea);
|
mainWindow.setCentralWidget(mdiArea);
|
||||||
mainWindow.menuBar();
|
mainWindow.menuBar();
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
QTest::qWaitForWindowShown(&mainWindow);
|
QVERIFY(QTest::qWaitForWindowExposed(&mainWindow));
|
||||||
QTest::qWait(60);
|
QTest::qWait(60);
|
||||||
|
|
||||||
|
|
||||||
@ -1626,7 +1626,7 @@ void tst_QMdiSubWindow::resizeTimer()
|
|||||||
QMdiArea mdiArea;
|
QMdiArea mdiArea;
|
||||||
QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
|
QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
|
||||||
mdiArea.show();
|
mdiArea.show();
|
||||||
QTest::qWaitForWindowShown(&mdiArea);
|
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
|
||||||
QTest::qWait(300);
|
QTest::qWait(300);
|
||||||
|
|
||||||
|
|
||||||
|
@ -429,10 +429,10 @@ void tst_QMenu::overrideMenuAction()
|
|||||||
m->addAction(aQuit);
|
m->addAction(aQuit);
|
||||||
|
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
|
||||||
QApplication::setActiveWindow(&w);
|
QApplication::setActiveWindow(&w);
|
||||||
w.setFocus();
|
w.setFocus();
|
||||||
QTRY_VERIFY(w.hasFocus());
|
QVERIFY(QTest::qWaitForWindowActive(&w));
|
||||||
|
QVERIFY(w.hasFocus());
|
||||||
|
|
||||||
//test of the action inside the menu
|
//test of the action inside the menu
|
||||||
QTest::keyClick(&w, Qt::Key_X, Qt::ControlModifier);
|
QTest::keyClick(&w, Qt::Key_X, Qt::ControlModifier);
|
||||||
@ -467,7 +467,7 @@ void tst_QMenu::statusTip()
|
|||||||
|
|
||||||
w.addToolBar(&tb);
|
w.addToolBar(&tb);
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWaitForWindowShown(&w);
|
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||||
|
|
||||||
QRect rect1 = tb.actionGeometry(&a);
|
QRect rect1 = tb.actionGeometry(&a);
|
||||||
QToolButton *btn = qobject_cast<QToolButton*>(tb.childAt(rect1.center()));
|
QToolButton *btn = qobject_cast<QToolButton*>(tb.childAt(rect1.center()));
|
||||||
@ -583,20 +583,20 @@ void tst_QMenu::layoutDirection()
|
|||||||
|
|
||||||
QMenu menu(&win);
|
QMenu menu(&win);
|
||||||
menu.show();
|
menu.show();
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
|
QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
|
||||||
menu.close();
|
menu.close();
|
||||||
|
|
||||||
menu.setParent(0);
|
menu.setParent(0);
|
||||||
menu.show();
|
menu.show();
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QCOMPARE(menu.layoutDirection(), QApplication::layoutDirection());
|
QCOMPARE(menu.layoutDirection(), QApplication::layoutDirection());
|
||||||
menu.close();
|
menu.close();
|
||||||
|
|
||||||
//now the menubar
|
//now the menubar
|
||||||
QAction *action = win.menuBar()->addMenu(&menu);
|
QAction *action = win.menuBar()->addMenu(&menu);
|
||||||
win.menuBar()->setActiveAction(action);
|
win.menuBar()->setActiveAction(action);
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
|
QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,7 +784,7 @@ void tst_QMenu::task258920_mouseBorder()
|
|||||||
QAction *action = menu.addAction("test");
|
QAction *action = menu.addAction("test");
|
||||||
|
|
||||||
menu.popup(QApplication::desktop()->availableGeometry().center());
|
menu.popup(QApplication::desktop()->availableGeometry().center());
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QTest::qWait(100);
|
QTest::qWait(100);
|
||||||
QRect actionRect = menu.actionGeometry(action);
|
QRect actionRect = menu.actionGeometry(action);
|
||||||
QTest::mouseMove(&menu, actionRect.center());
|
QTest::mouseMove(&menu, actionRect.center());
|
||||||
@ -834,7 +834,7 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
|
|||||||
desiredGeometry.moveTopLeft(QPoint(10, screen.bottom()-b.height()-5));
|
desiredGeometry.moveTopLeft(QPoint(10, screen.bottom()-b.height()-5));
|
||||||
|
|
||||||
b.setGeometry(desiredGeometry);
|
b.setGeometry(desiredGeometry);
|
||||||
QTest::qWaitForWindowShown(&b);
|
QVERIFY(QTest::qWaitForWindowExposed(&b));
|
||||||
|
|
||||||
if (b.geometry() != desiredGeometry) {
|
if (b.geometry() != desiredGeometry) {
|
||||||
// We are trying to put the button very close to the edge of the screen,
|
// We are trying to put the button very close to the edge of the screen,
|
||||||
@ -868,7 +868,7 @@ void tst_QMenu::QTBUG7907_submenus_autoselect()
|
|||||||
menu.addMenu(&set1);
|
menu.addMenu(&set1);
|
||||||
menu.addMenu(&set2);
|
menu.addMenu(&set2);
|
||||||
menu.show();
|
menu.show();
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) );
|
QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) );
|
||||||
QTest::qWait(500);
|
QTest::qWait(500);
|
||||||
QVERIFY(!subset.isVisible());
|
QVERIFY(!subset.isVisible());
|
||||||
@ -883,7 +883,7 @@ void tst_QMenu::QTBUG7411_submenus_activate()
|
|||||||
sub1.setTitle("&sub1");
|
sub1.setTitle("&sub1");
|
||||||
QAction *act1 = menu.addMenu(&sub1);
|
QAction *act1 = menu.addMenu(&sub1);
|
||||||
menu.show();
|
menu.show();
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
menu.setActiveAction(act);
|
menu.setActiveAction(act);
|
||||||
QTest::keyPress(&menu, Qt::Key_Down);
|
QTest::keyPress(&menu, Qt::Key_Down);
|
||||||
QCOMPARE(menu.activeAction(), act1);
|
QCOMPARE(menu.activeAction(), act1);
|
||||||
@ -906,7 +906,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_currentIndex = index;
|
m_currentIndex = index;
|
||||||
popup(QPoint());
|
popup(QPoint());
|
||||||
QTest::qWaitForWindowShown(this);
|
QVERIFY(QTest::qWaitForWindowExposed(this));
|
||||||
setActiveAction(dialogActions[index]);
|
setActiveAction(dialogActions[index]);
|
||||||
QTimer::singleShot(500, this, SLOT(checkVisibility()));
|
QTimer::singleShot(500, this, SLOT(checkVisibility()));
|
||||||
QTest::keyClick(this, Qt::Key_Enter); //activation
|
QTest::keyClick(this, Qt::Key_Enter); //activation
|
||||||
|
@ -241,8 +241,8 @@ void tst_QMenuBar::initTestCase()
|
|||||||
|
|
||||||
initSimpleMenubar();
|
initSimpleMenubar();
|
||||||
mw->show();
|
mw->show();
|
||||||
QTest::qWaitForWindowShown(mw);
|
|
||||||
mw->activateWindow();
|
mw->activateWindow();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(mw));
|
||||||
|
|
||||||
menu1 = new QtTestSlot( mw );
|
menu1 = new QtTestSlot( mw );
|
||||||
menu2 = new QtTestSlot( mw );
|
menu2 = new QtTestSlot( mw );
|
||||||
@ -1239,11 +1239,11 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten()
|
|||||||
menu.addAction("quit", &menubar, SLOT(close()), QKeySequence("ESC"));
|
menu.addAction("quit", &menubar, SLOT(close()), QKeySequence("ESC"));
|
||||||
menubar.show();
|
menubar.show();
|
||||||
QApplication::setActiveWindow(&menubar);
|
QApplication::setActiveWindow(&menubar);
|
||||||
QTest::qWaitForWindowShown(&menubar);
|
QVERIFY(QTest::qWaitForWindowExposed(&menubar));
|
||||||
menubar.setActiveAction(first);
|
menubar.setActiveAction(first);
|
||||||
QTRY_VERIFY(menu.isVisible());
|
QTRY_VERIFY(menu.isVisible());
|
||||||
QCOMPARE(menubar.activeAction(), first);
|
QCOMPARE(menubar.activeAction(), first);
|
||||||
QTest::qWaitForWindowShown(&menu);
|
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||||
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape);
|
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape);
|
||||||
QVERIFY(!menu.isVisible());
|
QVERIFY(!menu.isVisible());
|
||||||
QTRY_VERIFY(menubar.hasFocus());
|
QTRY_VERIFY(menubar.hasFocus());
|
||||||
|
@ -165,7 +165,7 @@ void tst_QProgressBar::format()
|
|||||||
bar.setRange(0, 10);
|
bar.setRange(0, 10);
|
||||||
bar.setValue(1);
|
bar.setValue(1);
|
||||||
bar.show();
|
bar.show();
|
||||||
QTest::qWaitForWindowShown(&bar);
|
QVERIFY(QTest::qWaitForWindowExposed(&bar));
|
||||||
|
|
||||||
QTest::qWait(20);
|
QTest::qWait(20);
|
||||||
bar.repainted = false;
|
bar.repainted = false;
|
||||||
@ -201,7 +201,7 @@ void tst_QProgressBar::setValueRepaint()
|
|||||||
pbar.setMaximum(10);
|
pbar.setMaximum(10);
|
||||||
pbar.setFormat("%v");
|
pbar.setFormat("%v");
|
||||||
pbar.show();
|
pbar.show();
|
||||||
QTest::qWaitForWindowShown(&pbar);
|
QVERIFY(QTest::qWaitForWindowExposed(&pbar));
|
||||||
|
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
for (int i = pbar.minimum(); i < pbar.maximum(); ++i) {
|
for (int i = pbar.minimum(); i < pbar.maximum(); ++i) {
|
||||||
|
@ -746,7 +746,7 @@ void tst_QSpinBox::editingFinished()
|
|||||||
|
|
||||||
testFocusWidget->show();
|
testFocusWidget->show();
|
||||||
QApplication::setActiveWindow(testFocusWidget);
|
QApplication::setActiveWindow(testFocusWidget);
|
||||||
QTest::qWaitForWindowShown(testFocusWidget);
|
QVERIFY(QTest::qWaitForWindowActive(testFocusWidget));
|
||||||
box->activateWindow();
|
box->activateWindow();
|
||||||
box->setFocus();
|
box->setFocus();
|
||||||
|
|
||||||
@ -971,7 +971,7 @@ void tst_QSpinBox::sizeHint()
|
|||||||
sizeHint_SpinBox *spinBox = new sizeHint_SpinBox;
|
sizeHint_SpinBox *spinBox = new sizeHint_SpinBox;
|
||||||
layout->addWidget(spinBox);
|
layout->addWidget(spinBox);
|
||||||
widget->show();
|
widget->show();
|
||||||
QTest::qWaitForWindowShown(widget);
|
QVERIFY(QTest::qWaitForWindowExposed(widget));
|
||||||
|
|
||||||
// Prefix
|
// Prefix
|
||||||
spinBox->sizeHintRequests = 0;
|
spinBox->sizeHintRequests = 0;
|
||||||
@ -1023,8 +1023,8 @@ void tst_QSpinBox::taskQTBUG_5008_textFromValueAndValidate()
|
|||||||
spinbox.activateWindow();
|
spinbox.activateWindow();
|
||||||
spinbox.setFocus();
|
spinbox.setFocus();
|
||||||
QApplication::setActiveWindow(&spinbox);
|
QApplication::setActiveWindow(&spinbox);
|
||||||
QTest::qWaitForWindowShown(&spinbox);
|
QVERIFY(QTest::qWaitForWindowActive(&spinbox));
|
||||||
QTRY_VERIFY(spinbox.hasFocus());
|
QVERIFY(spinbox.hasFocus());
|
||||||
QTRY_COMPARE(static_cast<QWidget *>(&spinbox), QApplication::activeWindow());
|
QTRY_COMPARE(static_cast<QWidget *>(&spinbox), QApplication::activeWindow());
|
||||||
QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value()));
|
QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value()));
|
||||||
spinbox.lineEdit()->setCursorPosition(2); //just after the first thousand separator
|
spinbox.lineEdit()->setCursorPosition(2); //just after the first thousand separator
|
||||||
|
@ -644,7 +644,7 @@ void tst_QTabBar::taskQTBUG_10052_widgetLayoutWhenMoving()
|
|||||||
tabBar.setTabButton(1, QTabBar::RightSide, &w2);
|
tabBar.setTabButton(1, QTabBar::RightSide, &w2);
|
||||||
|
|
||||||
tabBar.show();
|
tabBar.show();
|
||||||
QTest::qWaitForWindowShown(&tabBar);
|
QVERIFY(QTest::qWaitForWindowExposed(&tabBar));
|
||||||
w1.moved = w2.moved = false;
|
w1.moved = w2.moved = false;
|
||||||
tabBar.moveTab(0, 1);
|
tabBar.moveTab(0, 1);
|
||||||
QTRY_VERIFY(w1.moved);
|
QTRY_VERIFY(w1.moved);
|
||||||
|
@ -612,7 +612,7 @@ void tst_QTabWidget::minimumSizeHint()
|
|||||||
tw.addTab(page, QLatin1String("page1"));
|
tw.addTab(page, QLatin1String("page1"));
|
||||||
|
|
||||||
tw.show();
|
tw.show();
|
||||||
QTest::qWaitForWindowShown(&tw);
|
QVERIFY(QTest::qWaitForWindowExposed(&tw));
|
||||||
tw.resize(tw.minimumSizeHint());
|
tw.resize(tw.minimumSizeHint());
|
||||||
|
|
||||||
QSize minSize = label->minimumSizeHint();
|
QSize minSize = label->minimumSizeHint();
|
||||||
@ -660,7 +660,7 @@ void tst_QTabWidget::heightForWidth()
|
|||||||
window->resize(160, h);
|
window->resize(160, h);
|
||||||
window->show();
|
window->show();
|
||||||
|
|
||||||
QTest::qWaitForWindowShown(window);
|
QVERIFY(QTest::qWaitForWindowExposed(window));
|
||||||
QVERIFY(label->height() >= label->heightForWidth(label->width()));
|
QVERIFY(label->height() >= label->heightForWidth(label->width()));
|
||||||
|
|
||||||
delete window;
|
delete window;
|
||||||
|
@ -55,11 +55,10 @@ public:
|
|||||||
inline TestBrowser() : htmlLoadAttempts(0) {
|
inline TestBrowser() : htmlLoadAttempts(0) {
|
||||||
show();
|
show();
|
||||||
QApplication::setActiveWindow(this);
|
QApplication::setActiveWindow(this);
|
||||||
QTest::qWaitForWindowShown(this);
|
|
||||||
activateWindow();
|
activateWindow();
|
||||||
setFocus();
|
setFocus();
|
||||||
QTest::qWait(50);
|
QVERIFY(QTest::qWaitForWindowActive(this));
|
||||||
QTRY_VERIFY(hasFocus());
|
QVERIFY(hasFocus());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual QVariant loadResource(int type, const QUrl &name);
|
virtual QVariant loadResource(int type, const QUrl &name);
|
||||||
|
@ -2236,7 +2236,7 @@ void tst_QTextEdit::taskQTBUG_7902_contextMenuCrash()
|
|||||||
{
|
{
|
||||||
QTextEdit *w = new QTextEdit;
|
QTextEdit *w = new QTextEdit;
|
||||||
w->show();
|
w->show();
|
||||||
QTest::qWaitForWindowShown(w);
|
QVERIFY(QTest::qWaitForWindowExposed(w));
|
||||||
|
|
||||||
QTimer ti;
|
QTimer ti;
|
||||||
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
|
||||||
|
Loading…
Reference in New Issue
Block a user