view.setScene(&scene);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QPoint centerPos = view.mapFromScene(rect->boundingRect().center());
// Touch the button
view.resize(200, 200);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.fitInView(scene.sceneRect());
QTest::touchEvent(&view, touchScreenDevice)
QTextEdit *textEdit = new QTextEdit;
textEdit->setDocument(doc);
textEdit->show();
- QTest::qWaitForWindowShown(textEdit);
+ QVERIFY(QTest::qWaitForWindowExposed(textEdit));
table->mergeCells(0,merge.at(0), merge.at(1), merge.at(2));
//Don't crash !
table->insertColumns(insert.at(0), insert.at(1));
widget.setThread(&thread);
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
thread.start();
while (thread.isRunning()) {
connect(&thread, SIGNAL(createdAndUploaded(QImage)), &display, SLOT(receiveImage(QImage)));
display.show();
- QTest::qWaitForWindowShown(&display);
+ QVERIFY(QTest::qWaitForWindowActive(&display));
thread.start();
SceneRenderingThread thread(&widget);
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
widget.doneCurrent();
thread.start();
GLWidgetWrapper() {
widget.resize(150, 150);
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QTest::qWaitForWindowExposed(&widget);
widget.doneCurrent();
}
QPaintDevice *realPaintDevice() { return &widget; }
QPushButton b("Press me!");
b.resize(100, 50);
b.show();
- QTest::qWaitForWindowShown(&b);
+ QVERIFY(QTest::qWaitForWindowExposed(&b));
QImage img1 = b.grab().toImage();
QVERIFY(!img1.isNull());
QPushButton b("Press me!");
b.resize(100, 50);
b.show();
- QTest::qWaitForWindowShown(&b);
+ QVERIFY(QTest::qWaitForWindowExposed(&b));
QBASELINE_CHECK(b.grab().toImage(), "text1");
b.setText("Kick me!");
QPushButton b(label);
b.resize(100, 50);
b.show();
- QTest::qWaitForWindowShown(&b);
+ QVERIFY(QTest::qWaitForWindowExposed(&b));
QBASELINE_TEST(b.grab().toImage());
}
QPushButton b(label);
b.resize(100, 50);
b.show();
- QTest::qWaitForWindowShown(&b);
+ QVERIFY(QTest::qWaitForWindowExposed(&b));
QBASELINE_TEST(b.grab().toImage());
}
GestureWidget widget;
widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
CustomEvent event;
event.hotSpot = widget.mapToGlobal(QPoint(5,5));
item->setPos(100, 100);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
item->setPos(100, 100);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
item1_child2->setParentItem(item1);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
item2_child1->setPos(10, 10);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
item2_child1->setPos(0, 0);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
item0->setPos(14, 16);
view.show(); // need to show to give it a global coordinate
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
QPoint origin = view.mapToGlobal(QPoint());
parent.grabGesture(CustomGesture::GestureType);
child->grabGesture(secondGesture);
parent.show();
- QTest::qWaitForWindowShown(&parent);
+ QVERIFY(QTest::qWaitForWindowExposed(&parent));
/*
An event is send to both the child and the parent, when the child gets it a gesture is triggered
child->grabGesture(secondGesture);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
item1_c1_c1->setPos(0, 0);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item0->grabGesture(CustomGesture::GestureType, Qt::ReceivePartialGestures | Qt::IgnoredGesturesPropagateToParent);
item1_child1_child1->setZValue(10);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
panel->setZValue(5);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
items.insert(item2->objectName(), item2);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
if (propagateUpdateGesture)
scene.addItem(item1);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
scene.addItem(item4);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->ignoredUpdatedGestures << CustomGesture::GestureType;
//QGestureRecognizer::registerRecognizer(new PanRecognizer(PanRecognizer::Custom));
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
delete w;
}
gv->viewport()->grabGesture(tapGestureTypeId);
mw.show();
- QTest::qWaitForWindowShown(&mw);
+ QVERIFY(QTest::qWaitForWindowExposed(&mw));
QPoint targetPos(gv->mapFromScene(target->mapToScene(target->rect().center())));
targetPos = gv->viewport()->mapFromParent(targetPos);
scene.addItem(item2);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
NoConsumeWidgetBug13501 w;
w.grabGesture(Qt::TapGesture);
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
//QTest::mousePress(&ignoreEvent, Qt::LeftButton);
QTouchDevice *device = new QTouchDevice;
device->setType(QTouchDevice::TouchScreen);
{
QPushButton *button = new QPushButton;
button->show();
- QTest::qWaitForWindowShown(button);
+ QVERIFY(QTest::qWaitForWindowExposed(button));
button->clearFocus();
QCOMPARE(button->hasFocus(), false);
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(button);
lay->addWidget(te);
window->show();
- QTest::qWaitForWindowShown(window);
+ QVERIFY(QTest::qWaitForWindowExposed(window));
/**************************************************
//qApp->setMainWidget( testFocusWidget ); Qt4
testFocusWidget->resize( 200,100 );
testFocusWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testFocusWidget));
// Applications don't get focus when launched from the command line on Mac.
#ifdef Q_OS_MAC
testFocusWidget->raise();
{
// On X11 we have to ensure the event was processed before doing any checking, on Windows
// this is processed straight away.
- QApplication::setActiveWindow(childFocusWidgetOne);
-
- for (int i = 0; i < 1000; ++i) {
- if (childFocusWidgetOne->isActiveWindow() && childFocusWidgetOne->hasFocus())
- break;
- childFocusWidgetOne->activateWindow();
- childFocusWidgetOne->setFocus();
- qApp->processEvents();
- QTest::qWait(100);
- }
-
- // The first lineedit should have focus
- QVERIFY( childFocusWidgetOne->hasFocus() );
+ QApplication::setActiveWindow(testFocusWidget);
+ childFocusWidgetOne->setFocus(); // The first lineedit should have focus
+ QVERIFY(QTest::qWaitForWindowActive(testFocusWidget));
+ QTRY_VERIFY(childFocusWidgetOne->hasFocus());
childFocusWidgetOne->focusInEventRecieved = false;
childFocusWidgetOne->focusInEventGotFocus = false;
d->show();
d->activateWindow(); // ### CDE
QApplication::setActiveWindow(d);
- QTest::qWaitForWindowShown(d);
+ QVERIFY(QTest::qWaitForWindowActive(d));
QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved);
QVERIFY(childFocusWidgetOne->focusOutEventLostFocus);
#ifdef Q_OS_MAC
QEXPECT_FAIL("", "QTBUG-22815", Abort);
#endif
+ if (QGuiApplication::platformName() == QStringLiteral("xcb"))
+ QSKIP("QTBUG-22815 - This test is unstable on this platform");
QTRY_VERIFY(childFocusWidgetOne->focusInEventRecieved);
QVERIFY(childFocusWidgetOne->focusInEventGotFocus);
}
}
v.show();
- QVERIFY(QTest::qWaitForWindowExposed(&v));
#ifdef Q_WS_X11
QCursor::setPos(v.geometry().center());
QApplication::syncX();
#endif
- QTest::qWait(20);
QApplication::setActiveWindow(&v);
+ QVERIFY(QTest::qWaitForWindowActive(&v));
QModelIndex index = model.index(cellToEdit.y(), cellToEdit.x());
v.edit(index);
view.show();
QApplication::setActiveWindow(&view);
- QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(static_cast<QWidget *>(&view), QApplication::activeWindow());
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCOMPARE(static_cast<QWidget *>(&view), QApplication::activeWindow());
view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum());
QTest::qWait(20);
table.show();
table.setSelectionMode(QAbstractItemView::ExtendedSelection);
table.selectAll();
- QTest::qWaitForWindowShown(&table);
+ QVERIFY(QTest::qWaitForWindowExposed(&table));
QModelIndex item = table.model()->index(1,1);
QRect itemRect = table.visualRect(item);
QTest::mouseMove(table.viewport(), itemRect.center());
widget.show();
widget.setFocus(Qt::OtherFocusReason);
QApplication::setActiveWindow(&widget);
- QTest::qWaitForWindowShown(&widget);
widget.activateWindow();
- QTRY_VERIFY(widget.hasFocus());
+ QVERIFY(QTest::qWaitForWindowActive(&widget));
+ QVERIFY(widget.hasFocus());
QVERIFY(!widget.header()->hasFocus());
widget.setFocusPolicy(Qt::NoFocus);
view.horizontalHeader()->moveSection(0,2);
view.setColumnHidden(1, true);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton);
QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
view.setSortingEnabled(true);
view.sortByColumn(0, Qt::AscendingOrder);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
const int column1Pos = view.horizontalHeader()->sectionViewportPosition(1) + 5; // +5 not to be on the handle
QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column1Pos, 0));
view.setItemDelegate(new TestItemDelegate);
view.show();
view.selectAll();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QStyleOptionViewItem option;
option.rect = view.visualRect(model.index(0, 0));
// mimic QStyledItemDelegate::initStyleOption logic
view2.setWrapping(true);
// We really want to make sure it is shown, because the layout won't be known until it is shown
view2.show();
- QTest::qWaitForWindowShown(&view2);
+ QVERIFY(QTest::qWaitForWindowExposed(&view2));
QTRY_VERIFY(view2.m_shown);
QVERIFY(view2.m_index.isValid());
view.setUniformItemSizes(true);
view.setRowHidden(0,true);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTest::qWait(10);
}
view.setBatchSize(2);
view.resize(200,400);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTest::qWait(100);
#if defined(Q_OS_WINCE)
#endif
topLevel.show();
- QTest::qWaitForWindowShown(&v);
- QApplication::processEvents();
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
v.setSelection(selectionRect, QItemSelectionModel::ClearAndSelect);
lv.setModel(&model);
lv.setFixedSize(100, 200);
topLevel.show();
- QTest::qWaitForWindowShown(&topLevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
//by default, the list view scrolls per item and has no wrapping
QModelIndex index = model.index(6,0);
QStringListModel model(QStringList() << QLatin1String("item1") << QString());
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTest::qWait(20);
}
QVERIFY(index.isValid());
view.setCurrentIndex(index);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
const int scrollValue = view.verticalScrollBar()->maximum();
view.verticalScrollBar()->setValue(scrollValue);
QCOMPARE(view.verticalScrollBar()->value(), scrollValue);
list.setModel(&model);
list.setViewMode(QListView::IconMode);
list.show();
- QTest::qWaitForWindowShown(&list);
list.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&list));
+
class MyItemDelegate : public QStyledItemDelegate
{
view.setViewMode(QListView::IconMode);
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
// Verfify that item sizes are non-uniform
QVERIFY(view.sizeHintForIndex(model.index(0, 0)).height() > view.sizeHintForIndex(model.index(1, 0)).height());
view.setViewMode(QListView::IconMode);
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
// Verfify that item sizes are non-uniform
QVERIFY(view.sizeHintForIndex(model.index(0, 0)).width() > view.sizeHintForIndex(model.index(1, 0)).width());
view.show();
QApplication::setActiveWindow(&view);
- QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(static_cast<QWidget *>(&view), QApplication::activeWindow());
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCOMPARE(static_cast<QWidget *>(&view), QApplication::activeWindow());
QTest::keyClick(&view, Qt::Key_Down);
QTest::qWait(30);
QTRY_COMPARE(view.currentIndex(), model.index(1,1));
//QTBUG-7929 should not crash
topLevel.show();
- QTest::qWaitForWindowShown(&topLevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
QScrollBar *bar = view.flow() == QListView::TopToBottom
? view.verticalScrollBar() : view.horizontalScrollBar();
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
model.setData( model.index(1, 0), QLatin1String("long long text"));
QTest::qWait(100); //leave time for relayouting the items
QRect rectLongText = view.visualRect(model.index(1,0));
w.setWordWrap(true);
w.setSpacing(10);
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QCOMPARE(w.horizontalScrollBar()->minimum(), w.horizontalScrollBar()->maximum());
}
vu.setModel(&model);
vu.show();
- QTest::qWaitForWindowShown(&vu);
+ QVERIFY(QTest::qWaitForWindowExposed(&vu));
int itemHeight = vu.visualRect(model.index(0, 0)).height();
int visibleRowCount = vu.viewport()->height() / itemHeight;
const int spacing = 40;
w.setSpacing(spacing);
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QCOMPARE(w.verticalScrollBar()->maximum(), w.contentsSize().height() - w.viewport()->geometry().height());
}
item->setHidden(true);
}
lw.show();
- QTest::qWaitForWindowShown(&lw);
+ QVERIFY(QTest::qWaitForWindowExposed(&lw));
// No crash, it's all right.
}
item->setHidden(true);
}
lw.show();
- QTest::qWaitForWindowShown(&lw);
+ QVERIFY(QTest::qWaitForWindowExposed(&lw));
}
void tst_QListView::taskQTBUG_21115_scrollToAndHiddenItems_data()
model.setStringList(list);
lv.setModel(&model);
lv.show();
- QTest::qWaitForWindowShown(&lv);
+ QVERIFY(QTest::qWaitForWindowExposed(&lv));
// Save first item rect for reference
QRect firstItemRect = lv.visualRect(model.index(0, 0));
QSignalSpy spy(&list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)));
- QTest::qWaitForWindowShown(&win);
+ QVERIFY(QTest::qWaitForWindowExposed(&win));
QCOMPARE(spy.count(), 0);
view.setCurrentIndex(index);
view.show();
- QTest::qWaitForWindowShown(&view);
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
int row = rowCount - 1;
int column = columnCount - 1;
// resizing to this size will ensure that there can ONLY_BE_ONE_CELL inside the view.
QSize forcedSize(columnWidth * 2, rowHeight * 2);
view.resize(forcedSize);
- QTest::qWaitForWindowShown(&view);
- QTest::qWait(50);
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
QTRY_COMPARE(view.size(), forcedSize);
view.setModel(&model);
QtTestTableView view(&toplevel);
toplevel.show();
- QTest::qWaitForWindowShown(&toplevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
//some styles change the scroll mode in their polish
view.setHorizontalScrollMode(QAbstractItemView::ScrollPerItem);
window.show();
QApplication::setActiveWindow(&window);
- QTest::qWaitForWindowShown(&window);
window.setFocus();
- QTest::qWait(100);
window.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&window));
// window
- QTRY_VERIFY(window.hasFocus());
+ QVERIFY(window.hasFocus());
QVERIFY(!view->hasFocus());
QVERIFY(!edit->hasFocus());
view.setModel(&model);
view.resize(200, 200);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(model.index(2, 0)).center());
}
view.setModel(&proxyModel);
view.setSortingEnabled(true);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.sortByColumn(0, Qt::AscendingOrder);
QTest::qWait(100);
table.setColumnWidth(1, 100); //normal column
table.setColumnWidth(2, 9000); //very big column
table.show();
- QTest::qWaitForWindowShown(&table);
+ QVERIFY(QTest::qWaitForWindowExposed(&table));
//some styles change the scroll mode in their polish
table.setHorizontalScrollMode(QAbstractItemView::ScrollPerItem);
view.setColumnWidth(c, 100);
topLevel.show();
- QTest::qWaitForWindowShown(&topLevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
view.setModel(&model);
tv.verticalHeader()->swapSections(0, model.rowCount() - 1);
tv.setCurrentIndex(model.index(model.rowCount() - 1, 0));
- QTest::qWaitForWindowShown(&tv);
+ QVERIFY(QTest::qWaitForWindowExposed(&tv));
QTest::keyClick(&tv, Qt::Key_PageUp); // PageUp won't scroll when at top
QTRY_COMPARE(tv.rowAt(0), tv.verticalHeader()->logicalIndex(0));
QStandardItemModel model(5,5);
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QString text = "long long long text";
const int textWidth = view.verticalHeader()->fontMetrics().width(text);
QStandardItemModel model(500,5);
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
int sbValueBefore = view.verticalScrollBar()->value();
QHeaderView *header = view.verticalHeader();
w.setModel(&model);
connect(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), &w, SLOT(onDataChanged()));
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
for (int i = 0; i < 10; i++)
{
QTest::mouseMove(w.viewport(), QPoint(50, 20));
view.setModel(&model);
view.setLayoutDirection(Qt::RightToLeft);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QItemSelectionRange range(model.index(2, 0), model.index(2, model.columnCount() - 1));
QItemSelection selection;
view.show();
view.update();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTRY_VERIFY(view.repainted);
QCOMPARE(view.iconSize(), QSize());
bool refreshed;
} tree;
tree.show();
- QTest::qWaitForWindowShown(&tree);
+ QVERIFY(QTest::qWaitForWindowExposed(&tree));
tree.refreshed = false;
QTreeWidgetItem *parent = new QTreeWidgetItem(QStringList() << "parent");
tree.addTopLevelItem(parent);
QStandardItemModel model;
tree.setModel(&model);
tree.show();
- QTest::qWaitForWindowShown(&tree);
+ QVERIFY(QTest::qWaitForWindowExposed(&tree));
QList<QStandardItem *> items;
for(int i=0; i<100; ++i){
items << new QStandardItem(QString::fromLatin1("item %1").arg(i));
view.hideColumn(0);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
delegate.paintedIndexes.clear();
QStandardItem sub1("sub1"), sub11("sub11");
root0.appendRow(QList<QStandardItem*>() << &sub1 << &sub11);
view.setFirstColumnSpanned(0, QModelIndex(), true);
view.show();
QApplication::setActiveWindow(&view);
- QTest::qWaitForWindowShown(&view);
- QTRY_VERIFY(view.isActiveWindow());
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+ QVERIFY(view.isActiveWindow());
QPoint p(10, 10);
QCOMPARE(view.indexAt(p), model.index(0, 0));
view.painted = 0;
view.doCompare = false;
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTRY_VERIFY(view.painted > 0);
QTest::qWait(100); // This one is needed to make the test fail before the patch.
model.bindView(&treeView);
treeView.expandAll();
treeView.show();
- QTest::qWaitForWindowShown(&treeView);
+ QVERIFY(QTest::qWaitForWindowExposed(&treeView));
QTest::keyPress(treeView.viewport(), Qt::Key_Down);
QTest::qWait(10);
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
view.setModel(&model);
view.show();
- QTest::qWaitForWindowShown(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.scrollToBottom();
QTest::qWait(10);
frame.setLayout(layout);
frame.show();
- QTest::qWaitForWindowShown(&frame);
QApplication::setActiveWindow(&frame);
+ QVERIFY(QTest::qWaitForWindowActive(&frame));
widget->setFocus();
QApplication::processEvents();
QCursor::setPos(QPoint(0,0));
#endif
- QTest::qWaitForWindowShown(&frame);
QApplication::setActiveWindow(&frame);
- QTest::qWait(60);
+ QVERIFY(QTest::qWaitForWindowActive(&frame));
//move the mouse inside the widget, it should be colored
QTest::mouseMove ( widget, QPoint(6,6));
QTest::qWait(60);
QWidget* widget = widgets[c];
widget->show();
- QTest::qWaitForWindowShown(widget);
+ QVERIFY(QTest::qWaitForWindowExposed(widget));
QImage image(widget->width(), widget->height(), QImage::Format_ARGB32);
widget->render(&image);
tabWidget.addTab(new QLabel("tab1"),"tab1");
tabWidget.resize(QSize(400,400));
topLevel.show();
- QTest::qWaitForWindowShown(&tabWidget);
- QTest::qWait(50);
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
QTabBar *bar = qFindChild<QTabBar*>(&tabWidget);
QVERIFY(bar);
//check the tab is on the right
layout.addWidget(new QGroupBox("some text", &w));
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
//workaround the fact that the label sizehint is one pixel different the first time.
label.setIndent(0); //force to recompute the sizeHint:
w.setFocus();
frame.setLayout(layout);
frame.show();
- QTest::qWaitForWindowShown(&frame);
QApplication::setActiveWindow(&frame);
+ QVERIFY(QTest::qWaitForWindowActive(&frame));
foreach (QWidget *widget, widgets) {
widget->setFocus();
QApplication::processEvents();
frame.setLayout(layout);
frame.show();
- QTest::qWaitForWindowShown(&frame);
QApplication::setActiveWindow(&frame);
spinbox->setFocus();
- QApplication::processEvents();
+ QVERIFY(QTest::qWaitForWindowActive(&frame));
QImage image(frame.width(), frame.height(), QImage::Format_ARGB32);
frame.render(&image);
w = new Widget();
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
delete w;
qApp->setStyleSheet(QString());
}
} w;
w.setStyleSheet("* { background-color: white; color:black; border 3px solid yellow }");
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
}
QWidget window;
window.show();
QApplication::setActiveWindow(&window);
- QTest::qWaitForWindowShown(&window);
- QTRY_VERIFY(qApp->activeWindow() == &window);
+ QVERIFY(QTest::qWaitForWindowActive(&window));
+ QVERIFY(qApp->activeWindow() == &window);
QFocusEvent focusIn(QEvent::FocusIn);
QFocusEvent focusOut(QEvent::FocusOut);
QWidget w;
w.show();
QApplication::setActiveWindow(&w);
- QTest::qWaitForWindowShown(&w);
- QTRY_VERIFY(!edit.hasFocus() && !comp.popup()->hasFocus());
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+ QVERIFY(!edit.hasFocus() && !comp.popup()->hasFocus());
QVERIFY(fs.createDirectory(tmpDir.filePath("hemo")));
//there is no reason creating a file should open a popup, it did in Qt 4.7.0