diff options
Diffstat (limited to 'tests/auto/widgets')
116 files changed, 854 insertions, 217 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index b950bf3957..09e070ac20 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -367,7 +367,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() fd.selectFile(ctx.file.fileName()); fd.show(); - QTest::qWaitForWindowActive(&fd); + QVERIFY(QTest::qWaitForWindowActive(&fd)); // grab some internals: QAction *rm = fd.findChild<QAction*>("qt_delete_action"); diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 8da6ef0363..62286d703f 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -47,6 +47,7 @@ class tst_QInputDialog : public QObject static void testFuncGetDouble(QInputDialog *dialog); static void testFuncGetText(QInputDialog *dialog); static void testFuncGetItem(QInputDialog *dialog); + static void testFuncSingleStepDouble(QInputDialog *dialog); void timerEvent(QTimerEvent *event); private slots: void getInt_data(); @@ -61,6 +62,8 @@ private slots: void getItem(); void task256299_getTextReturnNullStringOnRejected(); void inputMethodHintsOfChildWidget(); + void setDoubleStep_data(); + void setDoubleStep(); }; QString stripFraction(const QString &s) @@ -498,5 +501,45 @@ void tst_QInputDialog::inputMethodHintsOfChildWidget() QCOMPARE(editWidget->inputMethodHints(), Qt::ImhDigitsOnly); } +void tst_QInputDialog::testFuncSingleStepDouble(QInputDialog *dialog) +{ + QDoubleSpinBox *sbox = dialog->findChild<QDoubleSpinBox *>(); + QVERIFY(sbox); + QTest::keyClick(sbox, Qt::Key_Up); +} + +void tst_QInputDialog::setDoubleStep_data() +{ + QTest::addColumn<double>("min"); + QTest::addColumn<double>("max"); + QTest::addColumn<int>("decimals"); + QTest::addColumn<double>("doubleStep"); + QTest::addColumn<double>("actualResult"); + QTest::newRow("step 2.0") << 0.0 << 10.0 << 0 << 2.0 << 2.0; + QTest::newRow("step 2.5") << 0.5 << 10.5 << 1 << 2.5 << 3.0; + QTest::newRow("step 2.25") << 10.05 << 20.05 << 2 << 2.25 << 12.30; + QTest::newRow("step 2.25 fewer decimals") << 0.5 << 10.5 << 1 << 2.25 << 2.75; +} + +void tst_QInputDialog::setDoubleStep() +{ + QFETCH(double, min); + QFETCH(double, max); + QFETCH(int, decimals); + QFETCH(double, doubleStep); + QFETCH(double, actualResult); + QWidget p; + parent = &p; + doneCode = QDialog::Accepted; + testFunc = &tst_QInputDialog::testFuncSingleStepDouble; + startTimer(0); + bool ok = false; + const double result = QInputDialog::getDouble(parent, QString(), QString(), min, min, + max, decimals, &ok, QFlags<Qt::WindowType>(), + doubleStep); + QVERIFY(ok); + QCOMPARE(result, actualResult); +} + QTEST_MAIN(tst_QInputDialog) #include "tst_qinputdialog.moc" diff --git a/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST b/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST new file mode 100644 index 0000000000..36e47830d0 --- /dev/null +++ b/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST @@ -0,0 +1,2 @@ +[defaultButton] +osx ci diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index d6c4841b22..6a16e48394 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -185,6 +185,12 @@ void tst_QMessageBox::cleanup() void tst_QMessageBox::sanityTest() { +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1362"); + return; + } +#endif QMessageBox msgBox; msgBox.setText("This is insane"); for (int i = 0; i < 10; i++) @@ -588,7 +594,7 @@ void tst_QMessageBox::detailsText() box.setDetailedText(text); QCOMPARE(box.detailedText(), text); box.show(); - QTest::qWaitForWindowExposed(&box); + QVERIFY(QTest::qWaitForWindowExposed(&box)); // QTBUG-39334, the box should now have the default "Ok" button as well as // the "Show Details.." button. QCOMPARE(box.findChildren<QAbstractButton *>().size(), 2); @@ -641,7 +647,7 @@ void tst_QMessageBox::expandDetails_QTBUG_32473() // that the window manager is also done manipulating the first QMessageBox. QWidget fleece; fleece.show(); - QTest::qWaitForWindowExposed(&fleece); + QVERIFY(QTest::qWaitForWindowExposed(&fleece)); if (geom.topLeft() == box.geometry().topLeft()) QTest::qWait(500); QCOMPARE(geom.topLeft(), box.geometry().topLeft()); diff --git a/tests/auto/widgets/gestures/gestures.pro b/tests/auto/widgets/gestures/gestures.pro deleted file mode 100644 index 5a87a01ee2..0000000000 --- a/tests/auto/widgets/gestures/gestures.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE=subdirs -SUBDIRS=\ - qgesturerecognizer \ - -mac: SUBDIRS -= \ # Uses native recognizers - qgesturerecognizer \ diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 96827022a8..2abb6e3515 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -11419,7 +11419,7 @@ void tst_QGraphicsItem::doNotMarkFullUpdateIfNotInScene() item2->setParentItem(item); scene.addItem(item); view.show(); - QTest::qWaitForWindowActive(view.windowHandle()); + QVERIFY(QTest::qWaitForWindowActive(view.windowHandle())); view.activateWindow(); QTRY_VERIFY(view.isActiveWindow()); QTRY_VERIFY(view.repaints >= 1); diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index e49cd87941..07d195b3e8 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -824,7 +824,7 @@ void tst_QGraphicsProxyWidget::focusOutEvent() QApplication::setActiveWindow(&view); view.activateWindow(); view.setFocus(); - QTest::qWaitForWindowActive(&view); + QVERIFY(QTest::qWaitForWindowActive(&view)); QTRY_VERIFY(view.isVisible()); QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST index c6f69a51a5..70170d2822 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST @@ -1,3 +1,5 @@ [removeItem] # QTBUG-60754, QTest::mouseMove is not always respected, or the CI moves the cursor osx-10.11 ci +[isActive] +opensuse-42.3 ci diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST index 3cba8bad7e..40d106e3ba 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST +++ b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST @@ -12,7 +12,5 @@ xcb xcb [forwardMousePress] xcb -[hoverLeave] -xcb [resizeAnchor] xcb diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 121836234d..ac38819385 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -688,7 +688,7 @@ void tst_QGraphicsView::openGLViewport() view.setViewport(glw); view.show(); - QTest::qWaitForWindowExposed(&view); + QVERIFY(QTest::qWaitForWindowExposed(&view)); QTRY_VERIFY(spy1.count() > 0); QTRY_VERIFY(spy2.count() >= spy1.count()); spy1.clear(); @@ -2903,7 +2903,7 @@ void tst_QGraphicsView::scrollBarRanges() QFETCH(ExpectedValueDescription, vmax); QFETCH(bool, useStyledPanel); - if (useStyledPanel && style == "Macintosh" && platformName == QStringLiteral("cocoa")) + if (useStyledPanel && style == "macintosh" && platformName == QStringLiteral("cocoa")) QSKIP("Insignificant on OSX"); QScopedPointer<QStyle> stylePtr; @@ -4777,8 +4777,6 @@ class GraphicsItemWithHover : public QGraphicsRectItem { public: GraphicsItemWithHover() - : receivedEnterEvent(false), receivedLeaveEvent(false), - enterWidget(0), leaveWidget(0) { setRect(0, 0, 100, 100); setAcceptHoverEvents(true); @@ -4786,6 +4784,9 @@ public: bool sceneEvent(QEvent *event) { + if (!checkEvents) // ensures that we don't look at stray events before we are ready + return QGraphicsRectItem::sceneEvent(event); + if (event->type() == QEvent::GraphicsSceneHoverEnter) { receivedEnterEvent = true; enterWidget = static_cast<QGraphicsSceneHoverEvent *>(event)->widget(); @@ -4796,50 +4797,39 @@ public: return QGraphicsRectItem::sceneEvent(event); } - bool receivedEnterEvent; - bool receivedLeaveEvent; - QWidget *enterWidget; - QWidget *leaveWidget; + bool receivedEnterEvent = false; + bool receivedLeaveEvent = false; + QWidget *enterWidget = nullptr; + QWidget *leaveWidget = nullptr; + bool checkEvents = false; }; void tst_QGraphicsView::hoverLeave() { - if (platformName == QStringLiteral("cocoa")) { - QSKIP("Insignificant on OSX"); - } else if (platformName == QStringLiteral("minimal") - || (platformName == QStringLiteral("offscreen"))) { - QSKIP("Fails in minimal/offscreen platforms if forwardMouseDoubleClick has been run"); - } - const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); QGraphicsScene scene; QGraphicsView view(&scene); view.resize(160, 160); - view.move(availableGeometry.center() - QPoint(80, 80)); GraphicsItemWithHover *item = new GraphicsItemWithHover; scene.addItem(item); - // move the cursor out of the way - const QPoint outOfWindow = view.geometry().topRight() + QPoint(50, 0); - QCursor::setPos(outOfWindow); - view.showNormal(); qApp->setActiveWindow(&view); - QVERIFY(QTest::qWaitForWindowActive(&view)); - - QPoint pos = view.viewport()->mapToGlobal(view.mapFromScene(item->mapToScene(10, 10))); - QCursor::setPos(pos); + QVERIFY(QTest::qWaitForWindowExposed(&view)); -#if defined(Q_OS_QNX) - QEXPECT_FAIL("", "QCursor does not set native cursor on QNX", Abort); -#endif + QWindow *viewWindow = view.window()->windowHandle(); + QPoint posOutsideItem = view.mapFromScene(item->mapToScene(0, 0)) - QPoint(5, 0); + QPoint posOutsideItemGlobal = view.mapToGlobal(posOutsideItem); + QPoint posOutsideItemInWindow = viewWindow->mapFromGlobal(posOutsideItemGlobal); + QTest::mouseMove(viewWindow, posOutsideItemInWindow); + item->checkEvents = true; + QPoint posInItemGlobal = view.mapToGlobal(view.mapFromScene(item->mapToScene(10, 10))); + QTest::mouseMove(viewWindow, viewWindow->mapFromGlobal(posInItemGlobal)); QTRY_VERIFY(item->receivedEnterEvent); QCOMPARE(item->enterWidget, view.viewport()); - QCursor::setPos(outOfWindow); -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-26274 - behaviour regression", Abort); -#endif + QTest::mouseMove(viewWindow, posOutsideItemInWindow); + QTRY_VERIFY(item->receivedLeaveEvent); QCOMPARE(item->leaveWidget, view.viewport()); } diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 2234b2b488..dc488fffc0 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -631,7 +631,9 @@ void tst_QAbstractItemView::rowDelegate() QVERIFY(QTest::qWaitForWindowExposed(&view)); QModelIndex index = model.index(3, 0); + QVERIFY(!view.isPersistentEditorOpen(index)); view.openPersistentEditor(index); + QVERIFY(view.isPersistentEditorOpen(index)); QWidget *w = view.indexWidget(index); QVERIFY(w); QCOMPARE(w->metaObject()->className(), "QWidget"); @@ -651,7 +653,9 @@ void tst_QAbstractItemView::columnDelegate() QVERIFY(QTest::qWaitForWindowExposed(&view)); QModelIndex index = model.index(0, 3); + QVERIFY(!view.isPersistentEditorOpen(index)); view.openPersistentEditor(index); + QVERIFY(view.isPersistentEditorOpen(index)); QWidget *w = view.indexWidget(index); QVERIFY(w); QCOMPARE(w->metaObject()->className(), "QWidget"); @@ -1239,8 +1243,8 @@ void tst_QAbstractItemView::task200665_itemEntered() moveCursorAway(&view); view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - QCursor::setPos( view.geometry().center() ); - QCoreApplication::processEvents(); + QCursor::setPos(view.geometry().center()); + QTRY_COMPARE(QCursor::pos(), view.geometry().center()); QSignalSpy spy(&view, SIGNAL(entered(QModelIndex))); view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum()); @@ -1811,7 +1815,7 @@ void tst_QAbstractItemView::shiftSelectionAfterChangingModelContents() view.setModel(&proxyModel); view.setSelectionMode(QAbstractItemView::ExtendedSelection); view.show(); - QTest::qWaitForWindowExposed(&view); + QVERIFY(QTest::qWaitForWindowExposed(&view)); // Click "C" QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, view.visualRect(indexC).center()); @@ -1925,7 +1929,7 @@ void tst_QAbstractItemView::QTBUG48968_reentrant_updateEditorGeometries() tree.setRootIsDecorated(false); QObject::connect(&tree, SIGNAL(doubleClicked(QModelIndex)), &tree, SLOT(setRootIndex(QModelIndex))); tree.show(); - QTest::qWaitForWindowActive(&tree); + QVERIFY(QTest::qWaitForWindowActive(&tree)); // Trigger editing idx QModelIndex idx = m->index(1, 0); @@ -2167,7 +2171,7 @@ void tst_QAbstractItemView::testClickToSelect() SetSelectionTestView view; view.setModel(&model); view.show(); - QTest::qWaitForWindowExposed(&view); + QVERIFY(QTest::qWaitForWindowExposed(&view)); QSignalSpy spy(&view, &SetSelectionTestView::setSelectionCalled); diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp index 5b353bb2ae..2a5895583d 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp @@ -1021,7 +1021,7 @@ void tst_QItemDelegate::decoration() } case QVariant::Image: { QImage img(size, QImage::Format_Mono); - memset(img.bits(), 0, img.byteCount()); + memset(img.bits(), 0, img.sizeInBytes()); value = img; break; } diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index b9785c35ac..2403eabd04 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -2163,7 +2163,7 @@ void tst_QListView::draggablePaintPairs() view.setModel(&model); view.show(); - QTest::qWaitForWindowExposed(&view); + QVERIFY(QTest::qWaitForWindowExposed(&view)); QModelIndex expectedIndex = model.index(row, 0); QListViewPrivate *privateClass = static_cast<QListViewPrivate *>(QListViewPrivate::get(&view)); @@ -2207,7 +2207,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys() lv.setSpacing(spacing); lv.setModel(&model); lv.show(); - QTest::qWaitForWindowExposed(&lv); + QVERIFY(QTest::qWaitForWindowExposed(&lv)); // hide every odd number row for (int i = 1; i < model.rowCount(); i+=2) @@ -2279,7 +2279,7 @@ void tst_QListView::spacing() lv.setModel(&model); lv.setSpacing(spacing); lv.show(); - QTest::qWaitForWindowExposed(&lv); + QVERIFY(QTest::qWaitForWindowExposed(&lv)); // check size and position of first two items QRect item1 = lv.visualRect(lv.model()->index(0, 0)); @@ -2310,7 +2310,7 @@ void tst_QListView::testScrollToWithHidden() lv.setSpacing(5); lv.showNormal(); - QTest::qWaitForWindowExposed(&lv); + QVERIFY(QTest::qWaitForWindowExposed(&lv)); QCOMPARE(lv.verticalScrollBar()->value(), 0); @@ -2455,7 +2455,7 @@ void tst_QListView::horizontalScrollingByVerticalWheelEvents() lv.resize(300, 300); lv.show(); - QTest::qWaitForWindowExposed(&lv); + QVERIFY(QTest::qWaitForWindowExposed(&lv)); QPoint globalPos = lv.geometry().center(); QPoint pos = lv.viewport()->geometry().center(); diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp index 6547bb8985..d4cb54b9ff 100644 --- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp @@ -1710,12 +1710,11 @@ void tst_QListWidget::QTBUG50891_ensureSelectionModelSignalConnectionsAreSet() list.setSelectionModel(new QItemSelectionModel(list.model())); list.show(); + QVERIFY(QTest::qWaitForWindowExposed(&list)); QSignalSpy currentItemChangedSpy(&list, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*))); QSignalSpy itemSelectionChangedSpy(&list, SIGNAL(itemSelectionChanged())); - QVERIFY(QTest::qWaitForWindowExposed(&list)); - QCOMPARE(currentItemChangedSpy.count(), 0); QCOMPARE(itemSelectionChangedSpy.count(), 0); diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index e2886cfcfe..b4adb84cd1 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -169,6 +169,9 @@ private slots: void styleOptionViewItem(); void keyboardNavigationWithDisabled(); + void statusTip_data(); + void statusTip(); + // task-specific tests: void task174627_moveLeftToRoot(); void task171902_expandWith1stColHidden(); @@ -213,6 +216,7 @@ public: void init() { decorationsEnabled = false; + statusTipsEnabled = false; } inline qint32 level(const QModelIndex &index) const { @@ -294,6 +298,19 @@ public: pm.fill(QColor::fromHsv((idx.column() % 16)*8 + 64, 254, (idx.row() % 16)*8 + 32)); return pm; } + if (statusTipsEnabled && role == Qt::StatusTipRole) + return QString("[%1,%2,%3] -- Status").arg(idx.row()).arg(idx.column()).arg(level(idx)); + return QVariant(); + } + + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const override + { + Q_UNUSED(orientation); + if (section < 0 || section >= columnCount()) + return QVariant(); + if (statusTipsEnabled && role == Qt::StatusTipRole) + return QString("Header %1 -- Status").arg(section); return QVariant(); } @@ -339,6 +356,7 @@ public: mutable bool fetched; bool decorationsEnabled; + bool statusTipsEnabled; int rows, cols; int levels; mutable bool wrongIndex; @@ -4220,7 +4238,7 @@ void tst_QTreeView::testInitialFocus() treeWidget.header()->hideSection(0); // make sure we skip hidden section(s) treeWidget.header()->swapSections(1, 2); // make sure that we look for first visual index (and not first logical) treeWidget.show(); - QTest::qWaitForWindowExposed(&treeWidget); + QVERIFY(QTest::qWaitForWindowExposed(&treeWidget)); QApplication::processEvents(); QCOMPARE(treeWidget.currentIndex().column(), 2); } @@ -4243,7 +4261,7 @@ void tst_QTreeView::quickExpandCollapse() QVERIFY(rootIndex.isValid()); tree.show(); - QTest::qWaitForWindowExposed(&tree); + QVERIFY(QTest::qWaitForWindowExposed(&tree)); const QAbstractItemView::State initialState = tree.state(); @@ -4405,5 +4423,52 @@ void tst_QTreeView::taskQTBUG_7232_AllowUserToControlSingleStep() QCOMPARE(hStep1, t.horizontalScrollBar()->singleStep()); } +void tst_QTreeView::statusTip_data() +{ + QTest::addColumn<bool>("intermediateParent"); + QTest::newRow("noIntermediate") << false; + QTest::newRow("intermediate") << true; +} + +void tst_QTreeView::statusTip() +{ + QFETCH(bool, intermediateParent); + QMainWindow mw; + QtTestModel model; + model.statusTipsEnabled = true; + model.rows = model.cols = 5; + QTreeView *view = new QTreeView; + view->setModel(&model); + view->viewport()->setMouseTracking(true); + view->header()->viewport()->setMouseTracking(true); + if (intermediateParent) { + QWidget *inter = new QWidget; + QVBoxLayout *vbox = new QVBoxLayout; + inter->setLayout(vbox); + vbox->addWidget(view); + mw.setCentralWidget(inter); + } else { + mw.setCentralWidget(view); + } + mw.statusBar(); + mw.setGeometry(QRect(QPoint(QApplication::desktop()->geometry().center() - QPoint(250, 250)), + QSize(500, 500))); + mw.show(); + qApp->setActiveWindow(&mw); + QVERIFY(QTest::qWaitForWindowActive(&mw)); + // Ensure it is moved away first and then moved to the relevant section + QTest::mouseMove(mw.windowHandle(), view->mapTo(&mw, view->rect().bottomLeft() + QPoint(20, 20))); + QPoint centerPoint = view->viewport()->mapTo(&mw, view->visualRect(model.index(0, 0)).center()); + QTest::mouseMove(mw.windowHandle(), centerPoint); + QTRY_COMPARE(mw.statusBar()->currentMessage(), QLatin1String("[0,0,0] -- Status")); + centerPoint = view->viewport()->mapTo(&mw, view->visualRect(model.index(0, 1)).center()); + QTest::mouseMove(mw.windowHandle(), centerPoint); + QTRY_COMPARE(mw.statusBar()->currentMessage(), QLatin1String("[0,1,0] -- Status")); + centerPoint = view->header()->viewport()->mapTo(&mw, + QPoint(view->header()->sectionViewportPosition(0) + view->header()->sectionSize(0) / 2, + view->header()->height() / 2)); + QTest::mouseMove(mw.windowHandle(), centerPoint); + QTRY_COMPARE(mw.statusBar()->currentMessage(), QLatin1String("Header 0 -- Status")); +} QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" diff --git a/tests/auto/widgets/kernel/kernel.pro b/tests/auto/widgets/kernel/kernel.pro index 20720dc928..73fd934502 100644 --- a/tests/auto/widgets/kernel/kernel.pro +++ b/tests/auto/widgets/kernel/kernel.pro @@ -6,6 +6,7 @@ SUBDIRS=\ qboxlayout \ qdesktopwidget \ qformlayout \ + qgesturerecognizer \ qgridlayout \ qlayout \ qstackedlayout \ @@ -19,4 +20,7 @@ SUBDIRS=\ qshortcut \ qsizepolicy +darwin:SUBDIRS -= \ # Uses native recognizers + qgesturerecognizer \ + SUBDIRS -= qsound diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp index 83e1850524..ac6362168e 100644 --- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp @@ -62,6 +62,7 @@ private slots: void task229128TriggeredSignalWithoutActiongroup(); void task229128TriggeredSignalWhenInActiongroup(); void repeat(); + void keysequence(); // QTBUG-53381 private: int m_lastEventType; @@ -276,6 +277,40 @@ void tst_QAction::alternateShortcuts() QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier); } +void tst_QAction::keysequence() +{ + MyWidget testWidget(this); + testWidget.show(); + QApplication::setActiveWindow(&testWidget); + + { + QAction act(&testWidget); + testWidget.addAction(&act); + + QKeySequence ks(QKeySequence::SelectAll); + + act.setShortcut(ks); + + QSignalSpy spy(&act, &QAction::triggered); + + act.setAutoRepeat(true); + QTest::keySequence(&testWidget, ks); + QCoreApplication::processEvents(); + QCOMPARE(spy.count(), 1); // act should have been triggered + + act.setAutoRepeat(false); + QTest::keySequence(&testWidget, ks); + QCoreApplication::processEvents(); + QCOMPARE(spy.count(), 2); //act should have been triggered a 2nd time + + // end of the scope of the action, it will be destroyed and removed from widget + // This action should also unregister its shortcuts + } + + // this tests a crash (if the action did not unregister its alternate shortcuts) + QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier); +} + void tst_QAction::enabledVisibleInteraction() { MyWidget testWidget(this); diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp index 0b35db1b5f..bcdd103531 100644 --- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp @@ -160,7 +160,7 @@ void tst_QBoxLayout::sizeHint() lay1->addLayout(lay2); window.setLayout(lay1); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); label->setText("foooooooo baaaaaaar"); QSize sh = lay1->sizeHint(); QApplication::processEvents(); @@ -181,7 +181,7 @@ void tst_QBoxLayout::sizeConstraints() lay->setSizeConstraint(QLayout::SetFixedSize); window.setLayout(lay); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); QSize sh = window.sizeHint(); delete lay->takeAt(1); QVERIFY(sh.width() >= window.sizeHint().width() && @@ -228,7 +228,7 @@ void tst_QBoxLayout::setStyleShouldChangeSpacing() style1->hspacing = 6; window.setStyle(style1.data()); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); int spacing = pb2->geometry().left() - pb1->geometry().right() - 1; QCOMPARE(spacing, 6); diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST b/tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST index 7f55c2dae0..7f55c2dae0 100644 --- a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST +++ b/tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/qgesturerecognizer.pro b/tests/auto/widgets/kernel/qgesturerecognizer/qgesturerecognizer.pro index 7c9ddcfb03..7c9ddcfb03 100644 --- a/tests/auto/widgets/gestures/qgesturerecognizer/qgesturerecognizer.pro +++ b/tests/auto/widgets/kernel/qgesturerecognizer/qgesturerecognizer.pro diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp index c3ebb838bb..c3ebb838bb 100644 --- a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp +++ b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index a04a67e4be..0b1d7b4437 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -74,7 +74,7 @@ osx [setClearAndResizeMask] osx [setToolTip] -osx-10.9 +osx [moveInResizeEvent] ubuntu-14.04 [moveChild:right] diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro index 499ca65516..0e95d454cf 100644 --- a/tests/auto/widgets/kernel/qwidget/qwidget.pro +++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro @@ -12,7 +12,7 @@ aix-g++*:QMAKE_CXXFLAGS+=-fpermissive CONFIG += x11inc mac { - LIBS += -framework Security -framework AppKit -framework Carbon + LIBS += -framework Security -framework AppKit OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index baecc43f2c..30fc927f7d 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -196,7 +196,10 @@ private slots: void mapFromAndTo(); void focusChainOnHide(); void focusChainOnReparent(); - void setTabOrder(); + void defaultTabOrder(); + void reverseTabOrder(); + void tabOrderWithProxy(); + void tabOrderWithCompoundWidgets(); #ifdef Q_OS_WIN void activation(); #endif @@ -1663,79 +1666,281 @@ public: class Composite : public QFrame { public: - Composite(QWidget* parent = 0, const char* name = 0) + Composite(QWidget* parent = 0, const QString &name = 0) : QFrame(parent) { setObjectName(name); - //QHBoxLayout* hbox = new QHBoxLayout(this, 2, 0); - //hbox->setAutoAdd(true); + + lineEdit1 = new QLineEdit; + lineEdit2 = new QLineEdit; + lineEdit3 = new QLineEdit; + lineEdit3->setEnabled(false); + QHBoxLayout* hbox = new QHBoxLayout(this); + hbox->addWidget(lineEdit1); + hbox->addWidget(lineEdit2); + hbox->addWidget(lineEdit3); + } - lineEdit = new QLineEdit(this); - hbox->addWidget(lineEdit); +public: + QLineEdit *lineEdit1; + QLineEdit *lineEdit2; + QLineEdit *lineEdit3; +}; - button = new QPushButton(this); - hbox->addWidget(button); - button->setFocusPolicy( Qt::NoFocus ); +void tst_QWidget::defaultTabOrder() +{ + const int compositeCount = 2; + Container container; + Composite *composite[compositeCount]; - setFocusProxy( lineEdit ); - setFocusPolicy( Qt::StrongFocus ); + QLineEdit *firstEdit = new QLineEdit; + container.box->addWidget(firstEdit); - setTabOrder(lineEdit, button); + for (int i = 0; i < compositeCount; i++) { + composite[i] = new Composite(); + container.box->addWidget(composite[i]); } -private: - QLineEdit* lineEdit; - QPushButton* button; -}; + QLineEdit *lastEdit = new QLineEdit(); + container.box->addWidget(lastEdit); -#define NUM_WIDGETS 4 + container.show(); + container.activateWindow(); + qApp->setActiveWindow(&container); + QVERIFY(QTest::qWaitForWindowActive(&container)); -void tst_QWidget::setTabOrder() -{ - QTest::qWait(100); + QTRY_VERIFY(firstEdit->hasFocus()); + // Check that focus moves between the line edits when we tab forward + for (int i = 0; i < compositeCount; ++i) { + container.tab(); + QVERIFY(composite[i]->lineEdit1->hasFocus()); + QVERIFY(!composite[i]->lineEdit2->hasFocus()); + container.tab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); + } + + container.tab(); + QVERIFY(lastEdit->hasFocus()); + + // Check that focus moves between the line edits in reverse + // order when we tab backwards + for (int i = compositeCount - 1; i >= 0; --i) { + container.backTab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); + + container.backTab(); + QVERIFY(composite[i]->lineEdit1->hasFocus()); + QVERIFY(!composite[i]->lineEdit2->hasFocus()); + } + + container.backTab(); + QVERIFY(firstEdit->hasFocus()); +} + +void tst_QWidget::reverseTabOrder() +{ + const int compositeCount = 2; Container container; - container.setObjectName("setTabOrder"); - container.setWindowTitle(container.objectName()); + Composite* composite[compositeCount]; + + QLineEdit *firstEdit = new QLineEdit(); + container.box->addWidget(firstEdit); + + for (int i = 0; i < compositeCount; i++) { + composite[i] = new Composite(); + container.box->addWidget(composite[i]); + } + + QLineEdit *lastEdit = new QLineEdit(); + container.box->addWidget(lastEdit); - Composite* comp[NUM_WIDGETS]; + // Reverse tab order inside each composite + for (int i = 0; i < compositeCount; ++i) + QWidget::setTabOrder(composite[i]->lineEdit2, composite[i]->lineEdit1); - QLineEdit *firstEdit = new QLineEdit(&container); + container.show(); + container.activateWindow(); + qApp->setActiveWindow(&container); + QVERIFY(QTest::qWaitForWindowActive(&container)); + + QTRY_VERIFY(firstEdit->hasFocus()); + + // Check that focus moves in reverse order when tabbing inside the composites + // (but in the correct order when tabbing between them) + for (int i = 0; i < compositeCount; ++i) { + container.tab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); + container.tab(); + QVERIFY(composite[i]->lineEdit1->hasFocus()); + QVERIFY(!composite[i]->lineEdit2->hasFocus()); + } + + container.tab(); + QVERIFY(lastEdit->hasFocus()); + + // Check that focus moves in "normal" order when tabbing backwards inside the + // composites (since backwards of reversed order cancels each other out), + // but in the reverse order when tabbing between them. + for (int i = compositeCount - 1; i >= 0; --i) { + container.backTab(); + QVERIFY(composite[i]->lineEdit1->hasFocus()); + QVERIFY(!composite[i]->lineEdit2->hasFocus()); + container.backTab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); + } + + container.backTab(); + QVERIFY(firstEdit->hasFocus()); +} + +void tst_QWidget::tabOrderWithProxy() +{ + const int compositeCount = 2; + Container container; + Composite* composite[compositeCount]; + + QLineEdit *firstEdit = new QLineEdit(); container.box->addWidget(firstEdit); - int i = 0; - for(i = 0; i < NUM_WIDGETS; i++) { - comp[i] = new Composite(&container); - container.box->addWidget(comp[i]); + for (int i = 0; i < compositeCount; i++) { + composite[i] = new Composite(); + container.box->addWidget(composite[i]); + + // Set second child as focus proxy + composite[i]->setFocusPolicy(Qt::StrongFocus); + composite[i]->setFocusProxy(composite[i]->lineEdit2); } - QLineEdit *lastEdit = new QLineEdit(&container); + QLineEdit *lastEdit = new QLineEdit(); container.box->addWidget(lastEdit); - container.setTabOrder(lastEdit, comp[NUM_WIDGETS-1]); - for(i = NUM_WIDGETS-1; i > 0; i--) { - container.setTabOrder(comp[i], comp[i-1]); + container.show(); + container.activateWindow(); + qApp->setActiveWindow(&container); + QVERIFY(QTest::qWaitForWindowActive(&container)); + + QTRY_VERIFY(firstEdit->hasFocus()); + + // Check that focus moves between the second line edits + // (the focus proxies) when we tab forward + for (int i = 0; i < compositeCount; ++i) { + container.tab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); } - container.setTabOrder(comp[0], firstEdit); - int current = NUM_WIDGETS-1; - lastEdit->setFocus(); + container.tab(); + QVERIFY(lastEdit->hasFocus()); + + // Check that focus moves between the line edits + // in reverse order when we tab backwards. + // Note that in this case, the focus proxies should not + // be taken into consideration, since they only take + // effect when tabbing forward + for (int i = compositeCount - 1; i >= 0; --i) { + container.backTab(); + QVERIFY(!composite[i]->lineEdit1->hasFocus()); + QVERIFY(composite[i]->lineEdit2->hasFocus()); + container.backTab(); + QVERIFY(composite[i]->lineEdit1->hasFocus()); + QVERIFY(!composite[i]->lineEdit2->hasFocus()); + } + + container.backTab(); + QVERIFY(firstEdit->hasFocus()); +} + +void tst_QWidget::tabOrderWithCompoundWidgets() +{ + const int compositeCount = 4; + Container container; + Composite *composite[compositeCount]; + + QLineEdit *firstEdit = new QLineEdit(); + container.box->addWidget(firstEdit); + + for (int i = 0; i < compositeCount; i++) { + composite[i] = new Composite(0, QStringLiteral("Composite: ") + QString::number(i)); + container.box->addWidget(composite[i]); + + // Let the composite handle focus, and set a child as focus proxy (use the second child, just + // to ensure that we don't just tab to the first child by coinsidence). This will make the + // composite "compound". Also enable the last line edit to have a bit more data to check when + // tabbing forwards. + composite[i]->setFocusPolicy(Qt::StrongFocus); + composite[i]->setFocusProxy(composite[i]->lineEdit2); + composite[i]->lineEdit3->setEnabled(true); + } + + QLineEdit *lastEdit = new QLineEdit(); + container.box->addWidget(lastEdit); + + // Reverse tab order between each composite + // (but not inside them), including first and last line edit. + // The result should not affect local tab order inside each + // composite, only between them. + QWidget::setTabOrder(lastEdit, composite[compositeCount - 1]); + for (int i = compositeCount - 1; i >= 1; --i) + QWidget::setTabOrder(composite[i], composite[i-1]); + QWidget::setTabOrder(composite[0], firstEdit); container.show(); container.activateWindow(); qApp->setActiveWindow(&container); QVERIFY(QTest::qWaitForWindowActive(&container)); + lastEdit->setFocus(); QTRY_VERIFY(lastEdit->hasFocus()); - container.tab(); - do { - QVERIFY(comp[current]->focusProxy()->hasFocus()); + + // Check that focus moves between the line edits in the normal + // order when tabbing inside each compound, but in the reverse + // order when tabbing between them. Since the composites have + // lineEdit2 as focus proxy, lineEdit2 will be the first with focus + // when the compound gets focus, and lineEdit1 will therefore be skipped. + for (int i = compositeCount - 1; i >= 0; --i) { + container.tab(); + Composite *c = composite[i]; + QVERIFY(!c->lineEdit1->hasFocus()); + QVERIFY(c->lineEdit2->hasFocus()); + QVERIFY(!c->lineEdit3->hasFocus()); container.tab(); - current--; - } while (current >= 0); + QVERIFY(!c->lineEdit1->hasFocus()); + QVERIFY(!c->lineEdit2->hasFocus()); + QVERIFY(c->lineEdit3->hasFocus()); + } + container.tab(); QVERIFY(firstEdit->hasFocus()); + + // Check that focus moves in reverse order when backTab inside the composites, but + // in the 'correct' order when backTab between them (since the composites are in reverse tab + // order from before, which cancels it out). Note that when we backtab into a compound, we start + // at lineEdit3 rather than the focus proxy, since that is the reverse of what happens when we tab + // forward. And this time we will also backtab to lineEdit1, since there is no focus proxy that interferes. + for (int i = 0; i < compositeCount; ++i) { + container.backTab(); + Composite *c = composite[i]; + QVERIFY(!c->lineEdit1->hasFocus()); + QVERIFY(!c->lineEdit2->hasFocus()); + QVERIFY(c->lineEdit3->hasFocus()); + container.backTab(); + QVERIFY(!c->lineEdit1->hasFocus()); + QVERIFY(c->lineEdit2->hasFocus()); + QVERIFY(!c->lineEdit3->hasFocus()); + container.backTab(); + QVERIFY(c->lineEdit1->hasFocus()); + QVERIFY(!c->lineEdit2->hasFocus()); + QVERIFY(!c->lineEdit3->hasFocus()); + } + + container.backTab(); + QVERIFY(lastEdit->hasFocus()); } #ifdef Q_OS_WIN @@ -1800,9 +2005,11 @@ void tst_QWidget::windowState() QCOMPARE(widget1.pos(), pos); QCOMPARE(widget1.size(), size); -#define VERIFY_STATE(s) QCOMPARE(int(widget1.windowState() & stateMask), int(s)) +#define VERIFY_STATE(s) \ + QCOMPARE(int(widget1.windowState() & stateMask), int(s)); \ + QCOMPARE(int(widget1.windowHandle()->windowStates() & stateMask), int(s)) - const int stateMask = Qt::WindowMaximized|Qt::WindowMinimized|Qt::WindowFullScreen; + const auto stateMask = Qt::WindowMaximized | Qt::WindowMinimized | Qt::WindowFullScreen; widget1.setWindowState(Qt::WindowMaximized); QTest::qWait(100); @@ -2092,7 +2299,7 @@ void tst_QWidget::resizeEvent() wParent.resize(200, 200); ResizeWidget wChild(&wParent); wParent.show(); - QTest::qWaitForWindowExposed(&wParent); + QVERIFY(QTest::qWaitForWindowExposed(&wParent)); QCOMPARE (wChild.m_resizeEventCount, 1); // initial resize event before paint wParent.hide(); QSize safeSize(640,480); @@ -2108,7 +2315,7 @@ void tst_QWidget::resizeEvent() ResizeWidget wTopLevel; wTopLevel.resize(200, 200); wTopLevel.show(); - QTest::qWaitForWindowExposed(&wTopLevel); + QVERIFY(QTest::qWaitForWindowExposed(&wTopLevel)); QCOMPARE (wTopLevel.m_resizeEventCount, 1); // initial resize event before paint for toplevels wTopLevel.hide(); QSize safeSize(640,480); @@ -2117,7 +2324,7 @@ void tst_QWidget::resizeEvent() wTopLevel.resize(safeSize); QCOMPARE (wTopLevel.m_resizeEventCount, 1); wTopLevel.show(); - QTest::qWaitForWindowExposed(&wTopLevel); + QVERIFY(QTest::qWaitForWindowExposed(&wTopLevel)); QCOMPARE (wTopLevel.m_resizeEventCount, 2); } } @@ -8070,8 +8277,8 @@ void tst_QWidget::setMaskInResizeEvent() QRegion expectedParentUpdate(0, 0, 100, 10); // Old testWidget area. expectedParentUpdate += testWidget.geometry(); // New testWidget area. - QCOMPARE(w.paintedRegion, expectedParentUpdate); - QCOMPARE(testWidget.paintedRegion, testWidget.mask()); + QTRY_COMPARE(w.paintedRegion, expectedParentUpdate); + QTRY_COMPARE(testWidget.paintedRegion, testWidget.mask()); testWidget.paintedRegion = QRegion(); // Now resize the widget again, but in the oposite direction @@ -10499,6 +10706,8 @@ void tst_QWidget::qmlSetParentHelper() void tst_QWidget::testForOutsideWSRangeFlag() { + QSKIP("Test assumes QWindows can have 0x0 size, see QTBUG-61953"); + // QTBUG-49445 { QWidget widget; diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index f20978c295..f7e1ffc6ba 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -100,6 +100,11 @@ private slots: void QTBUG_50561_QCocoaBackingStore_paintDevice_crash(); + void setWindowState_data(); + void setWindowState(); + + void nativeShow(); + void QTBUG_56277_resize_on_showEvent(); }; @@ -846,7 +851,7 @@ void tst_QWidget_window::QTBUG_50561_QCocoaBackingStore_paintDevice_crash() QMainWindow w; w.addToolBar(new QToolBar(&w)); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); // Simulate window system close QCloseEvent *e = new QCloseEvent; @@ -863,6 +868,72 @@ void tst_QWidget_window::QTBUG_50561_QCocoaBackingStore_paintDevice_crash() w.close(); } +void tst_QWidget_window::setWindowState_data() +{ + QString platformName = QGuiApplication::platformName().toLower(); + + QTest::addColumn<Qt::WindowStates>("state"); + QTest::newRow("0") << Qt::WindowStates(); + QTest::newRow("Qt::WindowMaximized") << Qt::WindowStates(Qt::WindowMaximized); + QTest::newRow("Qt::WindowMinimized") << Qt::WindowStates(Qt::WindowMinimized); + QTest::newRow("Qt::WindowFullScreen") << Qt::WindowStates(Qt::WindowFullScreen); + + if (platformName != "xcb" && platformName != "windows" && !platformName.startsWith("wayland") + && platformName != "offscreen") + return; // Combination of states is not preserved on all platforms. + if (platformName == "xcb" && qgetenv("XDG_CURRENT_DESKTOP") != "KDE" + && qgetenv("XDG_CURRENT_DESKTOP") != "Unity") + return; // Not all window managers support state combinations. + + QTest::newRow("Qt::WindowMaximized|Qt::WindowMinimized") + << (Qt::WindowMaximized | Qt::WindowMinimized); + QTest::newRow("Qt::WindowFullScreen|Qt::WindowMinimized") + << (Qt::WindowFullScreen | Qt::WindowMinimized); + QTest::newRow("Qt::WindowMaximized|Qt::WindowFullScreen") + << (Qt::WindowMaximized | Qt::WindowFullScreen); + QTest::newRow("Qt::WindowMaximized|Qt::WindowFullScreen|Qt::WindowMinimized") + << (Qt::WindowMaximized | Qt::WindowFullScreen | Qt::WindowMinimized); +} + +void tst_QWidget_window::setWindowState() +{ + QFETCH(Qt::WindowStates, state); + + // This tests make sure that the states are preserved when the window is shown. + + QWidget w; + w.setWindowState(state); + QCOMPARE(w.windowState(), state); + w.show(); + QCOMPARE(w.windowState(), state); + QCOMPARE(w.windowHandle()->windowStates(), state); + if (!(state & Qt::WindowMinimized)) + QVERIFY(QTest::qWaitForWindowExposed(&w)); + QTRY_COMPARE(w.windowState(), state); + QCOMPARE(w.windowHandle()->windowStates(), state); + + // Minimizing keeps other states + w.showMinimized(); + QCOMPARE(w.windowState(), state | Qt::WindowMinimized); + QTest::qWait(100); + QCOMPARE(w.windowState(), state | Qt::WindowMinimized); + QCOMPARE(w.windowHandle()->windowStates(), state | Qt::WindowMinimized); +} + +void tst_QWidget_window::nativeShow() +{ + // Verify that a native widget can be shown using the QWindow::setVisible() API + QWidget w; + w.winId(); + w.windowHandle()->setVisible(true); + QVERIFY(QTest::qWaitForWindowExposed(&w)); + QVERIFY(w.isVisible()); + + // ... and that we can hide it + w.windowHandle()->setVisible(false); + QTRY_VERIFY(!w.isVisible()); +} + class ResizedOnShowEventWidget : public QWidget { public: diff --git a/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro b/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro index 4cd85ab7f2..90bf134ef1 100644 --- a/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro +++ b/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro @@ -1,4 +1,4 @@ CONFIG += testcase TARGET = tst_qmacstyle -QT += widgets testlib +QT += widgets-private testlib SOURCES += tst_qmacstyle.cpp diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp index fbd1505b30..2ab2fa4c86 100644 --- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp +++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp @@ -29,12 +29,11 @@ #include <QtTest/QtTest> #include <QtWidgets> +#include <private/qstylehelper_p.h> const int N = 1; -enum Size { Normal, Small, Mini }; - -Q_DECLARE_METATYPE(Size); +Q_DECLARE_METATYPE(QStyleHelper::WidgetSizePolicy); #define CT(E) \ static const ControlType E = QSizePolicy::E; @@ -63,7 +62,7 @@ class tst_QMacStyle : public QObject Q_OBJECT public: - tst_QMacStyle() { qRegisterMetaType<Size>("Size"); } + tst_QMacStyle() { qRegisterMetaType<QStyleHelper::WidgetSizePolicy>("WidgetSizePolicy"); } private slots: void sizeHints_data(); @@ -85,27 +84,27 @@ private: static QSize gap(QWidget *widget1, QWidget *widget2); static int hgap(QWidget *widget1, QWidget *widget2) { return gap(widget1, widget2).width(); } static int vgap(QWidget *widget1, QWidget *widget2) { return gap(widget1, widget2).height(); } - static void setSize(QWidget *widget, Size size); + static void setSize(QWidget *widget, QStyleHelper::WidgetSizePolicy size); static int spacing(ControlType control1, ControlType control2, Qt::Orientation orientation, QStyleOption *option = 0, QWidget *widget = 0); - static int hspacing(ControlType control1, ControlType control2, Size size = Normal); - static int vspacing(ControlType control1, ControlType control2, Size size = Normal); + static int hspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge); + static int vspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge); }; #define SIZE(x, y, z) \ - ((size == Normal) ? (x) : (size == Small) ? (y) : (z)) + ((size == QStyleHelper::SizeLarge) ? (x) : (size == QStyleHelper::SizeSmall) ? (y) : (z)) void tst_QMacStyle::sizeHints_data() { - QTest::addColumn<Size>("size"); - QTest::newRow("normal") << Normal; -// QTest::newRow("small") << Small; -// QTest::newRow("mini") << Mini; + QTest::addColumn<QStyleHelper::WidgetSizePolicy>("size"); + QTest::newRow("normal") << QStyleHelper::SizeLarge; +// QTest::newRow("small") << QStyleHelper::SizeSmall; +// QTest::newRow("mini") << QStyleHelper::SizeMini; } void tst_QMacStyle::sizeHints() { - QFETCH(Size, size); + QFETCH(QStyleHelper::WidgetSizePolicy, size); QDialog w; setSize(&w, size); @@ -160,7 +159,7 @@ void tst_QMacStyle::sizeHints() QPushButton cancel1("Cancel", &w); QSize s1 = sh(&ok1); - if (size == Normal) { + if (size == QStyleHelper::SizeLarge) { // AHIG says 68, Builder does 70, and Qt seems to do 69 QVERIFY(s1.width() >= 68 && s1.width() <= 70); } @@ -222,7 +221,7 @@ void tst_QMacStyle::layoutMargins_data() void tst_QMacStyle::layoutMargins() { - QFETCH(Size, size); + QFETCH(QStyleHelper::WidgetSizePolicy, size); QWidget w; setSize(&w, size); @@ -235,7 +234,7 @@ void tst_QMacStyle::layoutSpacings_data() void tst_QMacStyle::layoutSpacings() { - QFETCH(Size, size); + QFETCH(QStyleHelper::WidgetSizePolicy, size); /* Constraints specified by AHIG. @@ -304,16 +303,16 @@ QSize tst_QMacStyle::gap(QWidget *widget1, QWidget *widget2) return s + QSize(d.x(), d.y()); } -void tst_QMacStyle::setSize(QWidget *widget, Size size) +void tst_QMacStyle::setSize(QWidget *widget, QStyleHelper::WidgetSizePolicy size) { switch (size) { - case Normal: + case QStyleHelper::SizeLarge: widget->setAttribute(Qt::WA_MacNormalSize, true); break; - case Small: + case QStyleHelper::SizeSmall: widget->setAttribute(Qt::WA_MacSmallSize, true); break; - case Mini: + case QStyleHelper::SizeMini: widget->setAttribute(Qt::WA_MacMiniSize, true); } } @@ -324,7 +323,7 @@ int tst_QMacStyle::spacing(ControlType control1, ControlType control2, Qt::Orien return QApplication::style()->layoutSpacing(control1, control2, orientation, option, widget); } -int tst_QMacStyle::hspacing(ControlType control1, ControlType control2, Size size) +int tst_QMacStyle::hspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size) { QWidget w; setSize(&w, size); @@ -335,7 +334,7 @@ int tst_QMacStyle::hspacing(ControlType control1, ControlType control2, Size siz return spacing(control1, control2, Qt::Horizontal, &opt); } -int tst_QMacStyle::vspacing(ControlType control1, ControlType control2, Size size) +int tst_QMacStyle::vspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size) { QWidget w; setSize(&w, size); diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index fcb05f6b74..d5ef2fe94b 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -88,9 +88,6 @@ private slots: void testFusionStyle(); #endif void testWindowsStyle(); -#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) - void testWindowsXPStyle(); -#endif #if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) void testWindowsVistaStyle(); #endif @@ -148,14 +145,6 @@ void tst_QStyle::testStyleFactory() #ifndef QT_NO_STYLE_WINDOWS QVERIFY(keys.contains("Windows")); #endif -#ifdef Q_OS_WIN - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && - (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) - QVERIFY(keys.contains("WindowsXP")); - if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && - (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) - QVERIFY(keys.contains("WindowsVista")); -#endif foreach (QString styleName , keys) { QStyle *style = QStyleFactory::create(styleName); @@ -301,16 +290,22 @@ bool tst_QStyle::testAllFunctions(QStyle *style) bool tst_QStyle::testScrollBarSubControls() { + const auto *style = testWidget->style(); + const bool isMacStyle = style->objectName().toLower() == "macintosh"; QScrollBar scrollBar; setFrameless(&scrollBar); scrollBar.show(); const QStyleOptionSlider opt = qt_qscrollbarStyleOption(&scrollBar); - foreach (int subControl, QList<int>() << 1 << 2 << 4 << 8) { - QRect sr = testWidget->style()->subControlRect(QStyle::CC_ScrollBar, &opt, - QStyle::SubControl(subControl), &scrollBar); + foreach (int sc, QList<int>() << 1 << 2 << 4 << 8) { + const auto subControl = static_cast<QStyle::SubControl>(sc); + const QRect sr = style->subControlRect(QStyle::CC_ScrollBar, &opt, subControl, &scrollBar); if (sr.isNull()) { - qWarning("Null rect for subcontrol %d", subControl); - return false; + // macOS scrollbars no longer have these, so there's no reason to fail + if (!(isMacStyle && (subControl == QStyle::SC_ScrollBarAddLine || + subControl == QStyle::SC_ScrollBarSubLine))) { + qWarning() << "Unexpected null rect for subcontrol" << subControl; + return false; + } } } return true; @@ -341,17 +336,6 @@ void tst_QStyle::testWindowsStyle() delete wstyle; } -#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) -// WindowsXP style -void tst_QStyle::testWindowsXPStyle() -{ - QStyle *xpstyle = QStyleFactory::create("WindowsXP"); - QVERIFY(testAllFunctions(xpstyle)); - lineUpLayoutTest(xpstyle); - delete xpstyle; -} -#endif - void writeImage(const QString &fileName, QImage image) { QImageWriter imageWriter(fileName); @@ -374,8 +358,6 @@ void tst_QStyle::testWindowsVistaStyle() if (QSysInfo::WindowsVersion == QSysInfo::WV_VISTA) testPainting(vistastyle, "vista"); - else if (QSysInfo::WindowsVersion == QSysInfo::WV_XP) - testPainting(vistastyle, "xp"); delete vistastyle; } #endif diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index efcc47171d..8b6c4722be 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -8,4 +8,3 @@ SUBDIRS=\ styles \ util \ widgets \ - gestures \ diff --git a/tests/auto/widgets/widgets/qcombobox/BLACKLIST b/tests/auto/widgets/widgets/qcombobox/BLACKLIST index 4a270c085b..c04351e5ca 100644 --- a/tests/auto/widgets/widgets/qcombobox/BLACKLIST +++ b/tests/auto/widgets/widgets/qcombobox/BLACKLIST @@ -1,3 +1,7 @@ QTBUG-45531 [task260974_menuItemRectangleForComboBoxPopup] osx-10.10 + +[task_QTBUG_56693_itemFontFromModel] +# Counts draw calls, but we could have multiple expose events QTBUG-62080 +osx diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index bf190cf60a..7c63497291 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -168,6 +168,7 @@ private slots: void task_QTBUG_49831_scrollerNotActivated(); void task_QTBUG_56693_itemFontFromModel(); void inputMethodUpdate(); + void task_QTBUG_52027_mapCompleterIndex(); private: PlatformInputContext m_platformInputContext; @@ -2260,7 +2261,7 @@ void tst_QComboBox::task190351_layout() listCombo.setCurrentIndex(70); listCombo.showPopup(); QTRY_VERIFY(listCombo.view()); - QTest::qWaitForWindowExposed(listCombo.view()); + QVERIFY(QTest::qWaitForWindowExposed(listCombo.view())); QTRY_VERIFY(listCombo.view()->isVisible()); QApplication::processEvents(); @@ -2407,7 +2408,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize() QTRY_VERIFY(comboBox.isVisible()); comboBox.showPopup(); QTRY_VERIFY(comboBox.view()); - QTest::qWaitForWindowExposed(comboBox.view()); + QVERIFY(QTest::qWaitForWindowExposed(comboBox.view())); QTRY_VERIFY(comboBox.view()->isVisible()); #if defined QT_BUILD_INTERNAL @@ -3253,12 +3254,12 @@ void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated() box.setModel(&model); box.setCurrentIndex(500); box.show(); - QTest::qWaitForWindowExposed(&box); + QVERIFY(QTest::qWaitForWindowExposed(&box)); QTest::mouseMove(&box, QPoint(5, 5), 100); box.showPopup(); QFrame *container = box.findChild<QComboBoxPrivateContainer *>(); QVERIFY(container); - QTest::qWaitForWindowExposed(container); + QVERIFY(QTest::qWaitForWindowExposed(container)); QList<QComboBoxPrivateScroller *> scrollers = container->findChildren<QComboBoxPrivateScroller *>(); // Not all styles support scrollers. We rely only on those platforms that do to catch any regression. @@ -3334,11 +3335,11 @@ void tst_QComboBox::task_QTBUG_56693_itemFontFromModel() box.addItem(QLatin1String("Item ") + QString::number(i)); box.show(); - QTest::qWaitForWindowExposed(&box); + QVERIFY(QTest::qWaitForWindowExposed(&box)); box.showPopup(); QFrame *container = box.findChild<QComboBoxPrivateContainer *>(); QVERIFY(container); - QTest::qWaitForWindowExposed(container); + QVERIFY(QTest::qWaitForWindowExposed(container)); QCOMPARE(proxyStyle->italicItemsNo, 5); @@ -3399,5 +3400,62 @@ void tst_QComboBox::inputMethodUpdate() QVERIFY(m_platformInputContext.m_updateCallCount >= 1); } +void tst_QComboBox::task_QTBUG_52027_mapCompleterIndex() +{ + QStringList words; + words << "" << "foobar1" << "foobar2"; + + QStringList altWords; + altWords << "foobar2" << "hello" << "," << "world" << "" << "foobar0" << "foobar1"; + + QComboBox cbox; + setFrameless(&cbox); + cbox.setEditable(true); + cbox.setInsertPolicy(QComboBox::NoInsert); + cbox.addItems(words); + + QCompleter *completer = new QCompleter(altWords); + completer->setCaseSensitivity(Qt::CaseInsensitive); + cbox.setCompleter(completer); + + QSignalSpy spy(&cbox, SIGNAL(activated(int))); + QCOMPARE(spy.count(), 0); + cbox.move(200, 200); + cbox.show(); + QApplication::setActiveWindow(&cbox); + QVERIFY(QTest::qWaitForWindowActive(&cbox)); + + QTest::keyClicks(&cbox, "foobar2"); + QApplication::processEvents(); + QTRY_VERIFY(completer->popup()); + QTest::keyClick(completer->popup(), Qt::Key_Down); + QApplication::processEvents(); + QTest::keyClick(completer->popup(), Qt::Key_Return); + QApplication::processEvents(); + QList<QVariant> arguments = spy.takeLast(); + QCOMPARE(arguments.at(0).toInt(), 2); + + cbox.lineEdit()->selectAll(); + cbox.lineEdit()->del(); + + QSortFilterProxyModel* model = new QSortFilterProxyModel(); + model->setSourceModel(cbox.model()); + model->setFilterFixedString("foobar1"); + completer->setModel(model); + + QApplication::setActiveWindow(&cbox); + QVERIFY(QTest::qWaitForWindowActive(&cbox)); + + QTest::keyClicks(&cbox, "foobar1"); + QApplication::processEvents(); + QTRY_VERIFY(completer->popup()); + QTest::keyClick(completer->popup(), Qt::Key_Down); + QApplication::processEvents(); + QTest::keyClick(completer->popup(), Qt::Key_Return); + QApplication::processEvents(); + arguments = spy.takeLast(); + QCOMPARE(arguments.at(0).toInt(), 1); +} + QTEST_MAIN(tst_QComboBox) #include "tst_qcombobox.moc" diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 94e4fc005c..a3571cd9c5 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -239,6 +239,8 @@ private slots: void deleteCalendarWidget(); + void setLocaleOnCalendarWidget(); + #ifdef QT_BUILD_INTERNAL void dateEditCorrectSectionSize_data(); void dateEditCorrectSectionSize(); @@ -3409,6 +3411,25 @@ void tst_QDateTimeEdit::deleteCalendarWidget() } } +void tst_QDateTimeEdit::setLocaleOnCalendarWidget() +{ + QDateEdit dateEdit; + QList<QLocale> allLocales = QLocale::matchingLocales( + QLocale::AnyLanguage, + QLocale::AnyScript, + QLocale::AnyCountry); + QLocale c = QLocale::c(); + dateEdit.setCalendarPopup(true); + dateEdit.setLocale(c); + for (const QLocale& l : allLocales) { + dateEdit.setLocale(l); + const QLocale locCal = dateEdit.calendarWidget()->locale(); + const QLocale locEdit = dateEdit.locale(); + QCOMPARE(locCal.name(), locEdit.name()); + QVERIFY(locCal == locEdit); + } +} + #ifdef QT_BUILD_INTERNAL typedef QPair<Qt::Key, Qt::KeyboardModifier> KeyPair; diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_0.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_0.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_1.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_1.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_2.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_2.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_0.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_0.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_1.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_1.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_2.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_2.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_0.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_1.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_2.png b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_noshadow_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_0_0.png b/tests/auto/widgets/widgets/qframe/images/box_plain_0_0.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_0_1.png b/tests/auto/widgets/widgets/qframe/images/box_plain_0_1.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_0_2.png b/tests/auto/widgets/widgets/qframe/images/box_plain_0_2.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_1_0.png b/tests/auto/widgets/widgets/qframe/images/box_plain_1_0.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_1_1.png b/tests/auto/widgets/widgets/qframe/images/box_plain_1_1.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_1_2.png b/tests/auto/widgets/widgets/qframe/images/box_plain_1_2.png Binary files differindex 0cc9090e3b..84be445138 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_2_0.png b/tests/auto/widgets/widgets/qframe/images/box_plain_2_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_2_1.png b/tests/auto/widgets/widgets/qframe/images/box_plain_2_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_plain_2_2.png b/tests/auto/widgets/widgets/qframe/images/box_plain_2_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_plain_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_plain_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_0_0.png b/tests/auto/widgets/widgets/qframe/images/box_raised_0_0.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_0_1.png b/tests/auto/widgets/widgets/qframe/images/box_raised_0_1.png Binary files differindex b2ab941d30..e35498674c 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_0_2.png b/tests/auto/widgets/widgets/qframe/images/box_raised_0_2.png Binary files differindex 21ebe53eff..b958b62259 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_1_0.png b/tests/auto/widgets/widgets/qframe/images/box_raised_1_0.png Binary files differindex 4f097cee48..879f6ddc31 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_1_1.png b/tests/auto/widgets/widgets/qframe/images/box_raised_1_1.png Binary files differindex 86f9ed6186..343caa06e4 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_1_2.png b/tests/auto/widgets/widgets/qframe/images/box_raised_1_2.png Binary files differindex 51a7899d05..377e1377f2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_2_0.png b/tests/auto/widgets/widgets/qframe/images/box_raised_2_0.png Binary files differindex 8c3769c32d..d59309bb3e 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_2_1.png b/tests/auto/widgets/widgets/qframe/images/box_raised_2_1.png Binary files differindex 81e0c2a152..36f6c0a9f3 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_raised_2_2.png b/tests/auto/widgets/widgets/qframe/images/box_raised_2_2.png Binary files differindex 107272d0b9..c6bdab7eb4 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_raised_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_raised_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_0.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_0.png Binary files differindex f1d6392779..2647ac98b2 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_1.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_1.png Binary files differindex b2ab941d30..e35498674c 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_2.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_2.png Binary files differindex 21ebe53eff..b958b62259 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_0.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_0.png Binary files differindex 6905baa1fd..7e57872d19 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_1.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_1.png Binary files differindex 9d5440b3aa..8bf9170f89 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_2.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_2.png Binary files differindex 17eb7f59c0..bb34a4db29 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_0.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_0.png Binary files differindex a6ccd54a39..4aa344ad54 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_1.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_1.png Binary files differindex 3736bf6c99..da5f2ba6b9 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_2.png b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_2.png Binary files differindex 5750751c58..80ce6d846e 100644 --- a/tests/auto/widgets/widgets/qframe/images/box_sunken_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/box_sunken_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_noshadow_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_0.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_1.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_2.png Binary files differindex 61f683df52..8c29cd9965 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_plain_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png Binary files differindex 00447760ec..a28358ec55 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png Binary files differindex 4c809a2c80..b5ea56f422 100644 --- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png +++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png diff --git a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp index 62224217d6..420ef56106 100644 --- a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp @@ -67,7 +67,7 @@ private slots: void toggledVsClicked(); void childrenAreDisabled(); void propagateFocus(); - void task_QTBUG_19170_ignoreMouseReleseEvent(); + void task_QTBUG_19170_ignoreMouseReleaseEvent(); void task_QTBUG_15519_propagateMouseEvents(); private: @@ -477,7 +477,7 @@ void tst_QGroupBox::propagateFocus() QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit)); } -void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent() +void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleaseEvent() { QGroupBox box; box.setCheckable(true); diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index cf1e19d598..71969ec695 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -1930,7 +1930,7 @@ void tst_QLineEdit::noCursorBlinkWhenReadOnly() centerOnScreen(&le); le.show(); le.setFocus(); - QTest::qWaitForWindowActive(&le); + QVERIFY(QTest::qWaitForWindowActive(&le)); le.updates = 0; QTest::qWait(cursorFlashTime); QVERIFY(le.updates > 0); @@ -1971,9 +1971,8 @@ static void figureOutProperKey(Qt::Key &key, Qt::KeyboardModifiers &pressState) break; } #else - // Naively kill the warning. - key = key; - pressState = pressState; + Q_UNUSED(key); + Q_UNUSED(pressState); #endif } @@ -3369,7 +3368,7 @@ void tst_QLineEdit::inlineCompletion() completer->setCaseSensitivity(Qt::CaseInsensitive); centerOnScreen(testWidget); testWidget->show(); - QTest::qWaitForWindowExposed(testWidget); + QVERIFY(QTest::qWaitForWindowExposed(testWidget)); testWidget->setFocus(); QTRY_COMPARE(qApp->activeWindow(), (QWidget*)testWidget); testWidget->setCompleter(completer); @@ -3697,7 +3696,7 @@ void tst_QLineEdit::task229938_dontEmitChangedWhenTextIsNotChanged() QLineEdit lineEdit; lineEdit.setMaxLength(5); lineEdit.show(); - QTest::qWaitForWindowExposed(&lineEdit); // to be safe and avoid failing setFocus with window managers + QVERIFY(QTest::qWaitForWindowExposed(&lineEdit)); // to be safe and avoid failing setFocus with window managers lineEdit.setFocus(); QSignalSpy changedSpy(&lineEdit, SIGNAL(textChanged(QString))); QTest::qWait(200); @@ -3987,6 +3986,8 @@ void tst_QLineEdit::QTBUG16850_setSelection() le.setText(" 1"); le.setSelection(3, 1); QCOMPARE(le.selectionStart(), 3); + QCOMPARE(le.selectionEnd(), 4); + QCOMPARE(le.selectionLength(), 1); QCOMPARE(le.selectedText(), QString("1")); } @@ -4181,11 +4182,16 @@ void tst_QLineEdit::inputMethodSelection() QCOMPARE(selectionSpy.count(), 0); QCOMPARE(testWidget->selectionStart(), -1); + QCOMPARE(testWidget->selectionEnd(), -1); + QCOMPARE(testWidget->selectionLength(), 0); testWidget->setSelection(0,5); QCOMPARE(selectionSpy.count(), 1); QCOMPARE(testWidget->selectionStart(), 0); + QCOMPARE(testWidget->selectionEnd(), 5); + QCOMPARE(testWidget->selectionLength(), 5); + // selection gained { @@ -4197,6 +4203,8 @@ void tst_QLineEdit::inputMethodSelection() QCOMPARE(selectionSpy.count(), 2); QCOMPARE(testWidget->selectionStart(), 12); + QCOMPARE(testWidget->selectionEnd(), 17); + QCOMPARE(testWidget->selectionLength(), 5); // selection removed { @@ -4207,6 +4215,10 @@ void tst_QLineEdit::inputMethodSelection() } QCOMPARE(selectionSpy.count(), 3); + QCOMPARE(testWidget->selectionStart(), -1); + QCOMPARE(testWidget->selectionEnd(), -1); + QCOMPARE(testWidget->selectionLength(), 0); + } Q_DECLARE_METATYPE(Qt::InputMethodHints) diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 292080c55f..30dc1e6043 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -2013,7 +2013,7 @@ void tst_QMainWindow::resizeDocks() mw.setCentralWidget(new QTextEdit); mw.show(); - QTest::qWaitForWindowExposed(&mw); + QVERIFY(QTest::qWaitForWindowExposed(&mw)); QFETCH(Qt::Orientation, orientation); QFETCH(QStringList, docks); diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index cfd6bb1247..1c970c43b3 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -3,3 +3,10 @@ osx [submenuTearOffDontClose] osx-10.11 ci osx-10.12 ci +[layoutDirection] +# Fails when enabling synchronous expose events QTBUG-62092 +osx ci +[pushButtonPopulateOnAboutToShow] +osx +[tearOff] +osx diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index f0fb7bc367..da37a9a968 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -126,6 +126,8 @@ private slots: #ifdef Q_OS_MAC void QTBUG_37933_ampersands_data(); void QTBUG_37933_ampersands(); +#else + void click_while_dismissing_submenu(); #endif void QTBUG_56917_wideMenuSize(); void QTBUG_56917_wideMenuScreenNumber(); @@ -1171,6 +1173,39 @@ void tst_QMenu::QTBUG20403_nested_popup_on_shortcut_trigger() QVERIFY(!subsub1.isVisible()); } +#ifndef Q_OS_MACOS +void tst_QMenu::click_while_dismissing_submenu() +{ + QMenu menu("Test Menu"); + QAction *action = menu.addAction("action"); + QMenu sub("&sub"); + sub.addAction("subaction"); + menu.addMenu(&sub); + centerOnScreen(&menu, QSize(120, 100)); + menu.show(); + QSignalSpy spy(action, SIGNAL(triggered())); + QSignalSpy menuShownSpy(&sub, SIGNAL(aboutToShow())); + QSignalSpy menuHiddenSpy(&sub, SIGNAL(aboutToHide())); + QVERIFY(QTest::qWaitForWindowExposed(&menu)); + //go over the submenu, press, move and release over the top level action + //this opens the submenu, move two times to emulate user interaction (d->motions > 0 in QMenu) + QTest::mouseMove(&menu, menu.rect().center() + QPoint(0,2)); + QTest::mouseMove(&menu, menu.rect().center() + QPoint(1,3), 60); + QVERIFY(menuShownSpy.wait()); + QVERIFY(sub.isVisible()); + QVERIFY(QTest::qWaitForWindowExposed(&sub)); + //press over the submenu entry + QTest::mousePress(&menu, Qt::LeftButton, 0, menu.rect().center() + QPoint(0,2), 300); + //move over the main action + QTest::mouseMove(&menu, menu.rect().center() - QPoint(0,2)); + QVERIFY(menuHiddenSpy.wait()); + //the submenu must have been hidden for the bug to be triggered + QVERIFY(!sub.isVisible()); + QTest::mouseRelease(&menu, Qt::LeftButton, 0, menu.rect().center() - QPoint(0,2), 300); + QCOMPARE(spy.count(), 1); +} +#endif + class MyWidget : public QWidget { public: diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 2a05900adc..49291cf5f9 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -62,6 +62,8 @@ private slots: void showHide(); void nativeWindow(); void stackWidgetOpaqueChildIsVisible(); + void offscreen(); + void offscreenThenOnscreen(); }; void tst_QOpenGLWidget::initTestCase() @@ -75,15 +77,17 @@ void tst_QOpenGLWidget::create() { QScopedPointer<QOpenGLWidget> w(new QOpenGLWidget); QVERIFY(!w->isValid()); + QVERIFY(w->textureFormat() == 0); QSignalSpy frameSwappedSpy(w.data(), SIGNAL(frameSwapped())); w->show(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); QVERIFY(frameSwappedSpy.count() > 0); QVERIFY(w->isValid()); QVERIFY(w->context()); QCOMPARE(w->context()->format(), w->format()); QVERIFY(w->defaultFramebufferObject() != 0); + QVERIFY(w->textureFormat() != 0); } class ClearWidget : public QOpenGLWidget, protected QOpenGLFunctions @@ -127,7 +131,7 @@ void tst_QOpenGLWidget::clearAndGrab() QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); w->resize(800, 600); w->show(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); QVERIFY(w->m_initCalled); QVERIFY(w->m_resizeCalled); QVERIFY(w->m_resizeOk); @@ -145,7 +149,7 @@ void tst_QOpenGLWidget::clearAndResizeAndGrab() QScopedPointer<QOpenGLWidget> w(new ClearWidget(0, 640, 480)); w->resize(640, 480); w->show(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); QImage image = w->grabFramebuffer(); QVERIFY(!image.isNull()); @@ -168,7 +172,7 @@ void tst_QOpenGLWidget::createNonTopLevel() QSignalSpy frameSwappedSpy(glw, SIGNAL(frameSwapped())); w.resize(400, 400); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); QVERIFY(frameSwappedSpy.count() > 0); QVERIFY(glw->m_resizeCalled); @@ -224,7 +228,7 @@ void tst_QOpenGLWidget::painter() w.resize(640, 480); glw->resize(320, 200); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); QImage image = glw->grabFramebuffer(); QCOMPARE(image.width(), glw->width()); @@ -245,11 +249,11 @@ void tst_QOpenGLWidget::reparentToAlreadyCreated() w1.resize(640, 480); glw->resize(320, 200); w1.show(); - QTest::qWaitForWindowExposed(&w1); + QVERIFY(QTest::qWaitForWindowExposed(&w1)); QWidget w2; w2.show(); - QTest::qWaitForWindowExposed(&w2); + QVERIFY(QTest::qWaitForWindowExposed(&w2)); glw->setParent(&w2); glw->show(); @@ -267,12 +271,12 @@ void tst_QOpenGLWidget::reparentToNotYetCreated() w1.resize(640, 480); glw->resize(320, 200); w1.show(); - QTest::qWaitForWindowExposed(&w1); + QVERIFY(QTest::qWaitForWindowExposed(&w1)); QWidget w2; glw->setParent(&w2); w2.show(); - QTest::qWaitForWindowExposed(&w2); + QVERIFY(QTest::qWaitForWindowExposed(&w2)); QImage image = glw->grabFramebuffer(); QCOMPARE(image.width(), 320); @@ -293,12 +297,12 @@ void tst_QOpenGLWidget::reparentHidden() glw->hide(); // Explicitly hidden - QTest::qWaitForWindowExposed(&topLevel1); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel1)); QWidget topLevel2; topLevel2.resize(640, 480); topLevel2.show(); - QTest::qWaitForWindowExposed(&topLevel2); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel2)); QOpenGLContext *originalContext = glw->context(); QVERIFY(originalContext); @@ -349,7 +353,7 @@ void tst_QOpenGLWidget::asViewport() layout->addWidget(btn); widget.setLayout(layout); widget.show(); - QTest::qWaitForWindowExposed(&widget); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); QVERIFY(view->paintCount() > 0); view->resetPaintCount(); @@ -377,7 +381,7 @@ void tst_QOpenGLWidget::requestUpdate() PaintCountWidget w; w.resize(640, 480); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); w.reset(); QCOMPARE(w.m_count, 0); @@ -401,7 +405,7 @@ void tst_QOpenGLWidget::fboRedirect() FboCheckWidget w; w.resize(640, 480); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); // Unlike in paintGL(), the default fbo reported by the context is not affected by the widget, // so we get the real default fbo: either 0 or (on iOS) the fbo associated with the window. @@ -416,7 +420,7 @@ void tst_QOpenGLWidget::showHide() QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); w->resize(800, 600); w->show(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); w->hide(); @@ -428,7 +432,7 @@ void tst_QOpenGLWidget::showHide() w->setClearColor(0, 0, 1); w->show(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); image = w->grabFramebuffer(); QVERIFY(!image.isNull()); @@ -443,7 +447,7 @@ void tst_QOpenGLWidget::nativeWindow() w->resize(800, 600); w->show(); w->winId(); - QTest::qWaitForWindowExposed(w.data()); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); QImage image = w->grabFramebuffer(); QVERIFY(!image.isNull()); @@ -462,7 +466,7 @@ void tst_QOpenGLWidget::nativeWindow() child->resize(400, 400); child->move(23, 34); nativeParent.show(); - QTest::qWaitForWindowExposed(&nativeParent); + QVERIFY(QTest::qWaitForWindowExposed(&nativeParent)); QVERIFY(nativeParent.internalWinId()); QVERIFY(!child->internalWinId()); @@ -582,8 +586,8 @@ void tst_QOpenGLWidget::stackWidgetOpaqueChildIsVisible() stack.setCurrentIndex(0); stack.resize(dimensionSize, dimensionSize); stack.show(); - QTest::qWaitForWindowExposed(&stack); - QTest::qWaitForWindowActive(&stack); + QVERIFY(QTest::qWaitForWindowExposed(&stack)); + QVERIFY(QTest::qWaitForWindowActive(&stack)); // Switch to the QOpenGLWidget. stack.setCurrentIndex(1); @@ -603,6 +607,74 @@ void tst_QOpenGLWidget::stackWidgetOpaqueChildIsVisible() #undef VERIFY_COLOR } +void tst_QOpenGLWidget::offscreen() +{ + { + QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); + w->resize(800, 600); + + w->setClearColor(0, 0, 1); + QImage image = w->grabFramebuffer(); + + QVERIFY(!image.isNull()); + QCOMPARE(image.width(), w->width()); + QCOMPARE(image.height(), w->height()); + QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255)); + } + + // QWidget::grab() should eventually end up in grabFramebuffer() as well + { + QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); + w->resize(800, 600); + + w->setClearColor(0, 0, 1); + QPixmap pm = w->grab(); + QImage image = pm.toImage(); + + QVERIFY(!image.isNull()); + QCOMPARE(image.width(), w->width()); + QCOMPARE(image.height(), w->height()); + QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255)); + } + + // ditto for QWidget::render() + { + QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); + w->resize(800, 600); + + w->setClearColor(0, 0, 1); + QImage image(800, 600, QImage::Format_ARGB32); + w->render(&image); + + QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255)); + } +} + +void tst_QOpenGLWidget::offscreenThenOnscreen() +{ + QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600)); + w->resize(800, 600); + + w->setClearColor(0, 0, 1); + QImage image = w->grabFramebuffer(); + + QVERIFY(!image.isNull()); + QCOMPARE(image.width(), w->width()); + QCOMPARE(image.height(), w->height()); + QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255)); + + // now let's make things more challenging: show. Internally this needs + // recreating the context. + w->show(); + QVERIFY(QTest::qWaitForWindowExposed(w.data())); + + image = w->grabFramebuffer(); + QVERIFY(!image.isNull()); + QCOMPARE(image.width(), w->width()); + QCOMPARE(image.height(), w->height()); + QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255)); +} + QTEST_MAIN(tst_QOpenGLWidget) #include "tst_qopenglwidget.moc" diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp index 205ef34958..9f64335930 100644 --- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp @@ -45,6 +45,7 @@ private slots: void destroyIndeterminate(); void text(); void format(); + void setValueRepaint_data(); void setValueRepaint(); #ifndef Q_OS_MAC void setMinMaxRepaint(); @@ -191,21 +192,49 @@ void tst_QProgressBar::format() QCOMPARE(bar.text(), QString()); } +void tst_QProgressBar::setValueRepaint_data() +{ + QTest::addColumn<int>("min"); + QTest::addColumn<int>("max"); + QTest::addColumn<int>("increment"); + + auto add = [](int min, int max, int increment) { + QTest::addRow("%d-%d@%d", min, max, increment) << min << max << increment; + }; + + add(0, 10, 1); + + auto add_set = [=](int min, int max, int increment) { + // check corner cases, and adjacent values (to circumvent explicit checks for corner cases) + add(min, max, increment); + add(min + 1, max, increment); + add(min, max - 1, increment); + add(min + 1, max - 1, increment); + }; + + add_set(INT_MIN, INT_MAX, INT_MAX / 50 + 1); + add_set(0, INT_MAX, INT_MAX / 100 + 1); + add_set(INT_MIN, 0, INT_MAX / 100 + 1); +} + void tst_QProgressBar::setValueRepaint() { + QFETCH(int, min); + QFETCH(int, max); + QFETCH(int, increment); + ProgressBar pbar; - pbar.setMinimum(0); - pbar.setMaximum(10); + pbar.setMinimum(min); + pbar.setMaximum(max); pbar.setFormat("%v"); pbar.move(300, 300); pbar.show(); QVERIFY(QTest::qWaitForWindowExposed(&pbar)); QApplication::processEvents(); - for (int i = pbar.minimum(); i < pbar.maximum(); ++i) { + for (qint64 i = min; i < max; i += increment) { pbar.repainted = false; - pbar.setValue(i); - QTest::qWait(50); + pbar.setValue(int(i)); QTRY_VERIFY(pbar.repainted); } } diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp index 7bbbc46b5a..2b54008de7 100644 --- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp @@ -520,9 +520,6 @@ void tst_QPushButton::sizeHint_data() #if !defined(QT_NO_STYLE_FUSION) QTest::newRow("fusion") << QString::fromLatin1("fusion"); #endif -#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP) - QTest::newRow("windowsxp") << QString::fromLatin1("windowsxp"); -#endif #if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) QTest::newRow("windowsvista") << QString::fromLatin1("windowsvista"); #endif @@ -597,7 +594,7 @@ void tst_QPushButton::taskQTBUG_20191_shortcutWithKeypadModifer() QDialog dialog; dialog.setLayout(layout); dialog.show(); - QTest::qWaitForWindowExposed(&dialog); + QVERIFY(QTest::qWaitForWindowExposed(&dialog)); QApplication::setActiveWindow(&dialog); // add shortcut '5' to button1 and test with keyboard and keypad '5' keys @@ -642,7 +639,7 @@ void tst_QPushButton::emitReleasedAfterChange() QDialog dialog; dialog.setLayout(layout); dialog.show(); - QTest::qWaitForWindowExposed(&dialog); + QVERIFY(QTest::qWaitForWindowExposed(&dialog)); QApplication::setActiveWindow(&dialog); button1->setFocus(); diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 5238eea592..5ef2c7bc50 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -78,7 +78,7 @@ void tst_QScrollBar::scrollSingleStep() testWidget.resize(100, testWidget.height()); centerOnScreen(&testWidget); testWidget.show(); - QTest::qWaitForWindowExposed(&testWidget); + QVERIFY(QTest::qWaitForWindowExposed(&testWidget)); testWidget.setValue(testWidget.minimum()); QCOMPARE(testWidget.value(), testWidget.minimum()); @@ -117,7 +117,7 @@ void tst_QScrollBar::task_209492() verticalScrollBar->setRange(0, 1000); centerOnScreen(&scrollArea); scrollArea.show(); - QTest::qWaitForWindowExposed(&scrollArea); + QVERIFY(QTest::qWaitForWindowExposed(&scrollArea)); QSignalSpy spy(verticalScrollBar, SIGNAL(actionTriggered(int))); QCOMPARE(scrollArea.scrollCount, 0); @@ -154,7 +154,7 @@ void tst_QScrollBar::QTBUG_27308() testWidget.resize(100, testWidget.height()); centerOnScreen(&testWidget); testWidget.show(); - QTest::qWaitForWindowExposed(&testWidget); + QVERIFY(QTest::qWaitForWindowExposed(&testWidget)); testWidget.setValue(testWidget.minimum()); testWidget.setEnabled(false); @@ -183,7 +183,7 @@ void tst_QScrollBar::QTBUG_42871() scrollBarWidget.resize(100, scrollBarWidget.height()); centerOnScreen(&scrollBarWidget); scrollBarWidget.show(); - QTest::qWaitForWindowExposed(&scrollBarWidget); + QVERIFY(QTest::qWaitForWindowExposed(&scrollBarWidget)); QSignalSpy spy(&scrollBarWidget, SIGNAL(actionTriggered(int))); QVERIFY(spy.isValid()); QCOMPARE(myHandler.updatesCount, 0); diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp index 72e6ffdeb5..aef4046afe 100644 --- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp @@ -828,7 +828,7 @@ void tst_QSplitter::handleMinimumWidth() split.addWidget(new QLabel("Number Too")); split.show(); - QTest::qWaitForWindowExposed(&split); + QVERIFY(QTest::qWaitForWindowExposed(&split)); for (int i = 0; i < 10; i++) { split.setHandleWidth(i); QTest::qWait(100); // resizing diff --git a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp index 2df5f01627..59a334fab9 100644 --- a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp +++ b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp @@ -180,7 +180,7 @@ void tst_QStackedWidget::dynamicPages() sw->resize(200, 200); sw->show(); qApp->setActiveWindow(sw); - QTest::qWaitForWindowActive(sw); + QVERIFY(QTest::qWaitForWindowActive(sw)); QTRY_COMPARE(QApplication::focusWidget(), le11); sw->setCurrentIndex(1); diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 55ef44f4e0..5fb6139e87 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -2507,7 +2507,7 @@ void tst_QTextEdit::highlightLongLine() }; NumHighlighter nh(edit.document()); edit.show(); - QTest::qWaitForWindowActive(edit.windowHandle()); + QVERIFY(QTest::qWaitForWindowActive(edit.windowHandle())); QCoreApplication::processEvents(); //If there is a quadratic behaviour, this would take forever. QVERIFY(true); |