diff options
author | Liang Qi <liang.qi@qt.io> | 2018-05-03 14:26:01 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-05-03 14:50:22 +0200 |
commit | 60fefff22f7fa259a8bdb023d1ec9a57cfd34bfb (patch) | |
tree | ab33ab6eeb08f7a72e0196ee5025790aaa01b1dd /tests/auto | |
parent | b1e0a71997111fc296001bc94e0da8342cf0ac97 (diff) | |
parent | da32360ffc3c7b677355c37ae54c89637c18047f (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
examples/widgets/graphicsview/elasticnodes/node.cpp
examples/widgets/graphicsview/elasticnodes/node.h
src/plugins/platforms/cocoa/qnsview.mm
src/plugins/platforms/cocoa/qnsview_drawing.mm
src/widgets/kernel/qmacgesturerecognizer_p.h
Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
Diffstat (limited to 'tests/auto')
6 files changed, 79 insertions, 9 deletions
diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp index 6e020ac35b..ae65d8f697 100644 --- a/tests/auto/corelib/tools/qline/tst_qline.cpp +++ b/tests/auto/corelib/tools/qline/tst_qline.cpp @@ -166,9 +166,6 @@ void tst_QLine::testIntersection_data() << 100.1599256468622 << 50.0; - QLineF baseA(0, -50, 0, 50); - QLineF baseB(-50, 0, 50, 0); - for (int i = 0; i < 1000; ++i) { QLineF a = QLineF::fromPolar(50, i); a.setP1(-a.p2()); diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index cd1cb99c3c..70091121bc 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -3,8 +3,6 @@ linux osx-10.12 ci [positioning:fake] osx-10.12 ci -[modalWindowPosition] -ubuntu-16.04 [modalWithChildWindow] ubuntu-16.04 # QTBUG-66851 diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8165ccbc58..8ebb27e58c 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -962,8 +962,10 @@ void tst_QUdpSocket::bindMode() // Depending on the user's privileges, this or will succeed or // fail. Admins are allowed to reuse the address, but nobody else. - if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()) - qWarning("Failed to bind with QUdpSocket::ReuseAddressHint, user isn't an administrator?"); + if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)) { + qWarning("Failed to bind with QUdpSocket::ReuseAddressHint(%s), user isn't an administrator?", + qPrintable(socket2.errorString())); + } socket.close(); QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); QVERIFY(!socket2.bind(socket.localPort())); diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp index 0767efb817..9abe9a77c0 100644 --- a/tests/auto/other/gestures/tst_gestures.cpp +++ b/tests/auto/other/gestures/tst_gestures.cpp @@ -331,6 +331,9 @@ private slots: void graphicsViewParentPropagation(); void panelPropagation(); void panelStacksBehindParent(); +#ifdef Q_OS_MACOS + void deleteMacPanGestureRecognizerTargetWidget(); +#endif void deleteGestureTargetWidget(); void deleteGestureTargetItem_data(); void deleteGestureTargetItem(); @@ -1807,6 +1810,31 @@ void tst_Gestures::panelStacksBehindParent() QCOMPARE(panel->gestureOverrideEventsReceived, 0); } +#ifdef Q_OS_MACOS +void tst_Gestures::deleteMacPanGestureRecognizerTargetWidget() +{ + QWidget window; + window.resize(400,400); + QGraphicsScene scene; + QGraphicsView *view = new QGraphicsView(&scene, &window); + view->resize(400, 400); + window.show(); + + QVERIFY(QTest::qWaitForWindowExposed(&window)); + QTouchDevice *device = QTest::createTouchDevice(); + // QMacOSPenGestureRecognizer will start a timer on a touch press event + QTest::touchEvent(&window, device).press(1, QPoint(100, 100), &window); + delete view; + + // wait until after that the QMacOSPenGestureRecognizer timer (300ms) is triggered. + // This is needed so that the whole test does not finish before the timer triggers + // and to make sure it crashes while executing *this* function. (otherwise it might give the + // impression that some of the subsequent test function caused the crash...) + + QTest::qWait(400); // DO NOT CRASH while waiting +} +#endif + void tst_Gestures::deleteGestureTargetWidget() { } diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index a612f0749b..a65dd0bf8f 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -122,6 +122,7 @@ private slots: void testPageMetrics_data(); void testPageMetrics(); + void reusePageMetrics(); #endif private: QString testFileName(const QString &prefix, const QString &suffix); @@ -1955,6 +1956,50 @@ QString tst_QPrinter::testFileName(const QString &prefix, const QString &suffix) return result; } +void tst_QPrinter::reusePageMetrics() +{ + QList<QPrinterInfo> availablePrinters = QPrinterInfo::availablePrinters(); + if (availablePrinters.size() < 2) + QSKIP("Not enough printers to do this test with, need at least 2 setup"); + QPrinter defaultP; + QPrinterInfo info(defaultP); + QString otherPrinterName; + for (QPrinterInfo i : qAsConst(availablePrinters)) { + if (i.printerName() != defaultP.printerName()) { + otherPrinterName = i.printerName(); + break; + } + } + QPrinter otherP(QPrinterInfo::printerInfo(otherPrinterName)); + QList<QPageSize> defaultPageSizes = info.supportedPageSizes(); + QList<QPageSize> otherPageSizes = QPrinterInfo(otherP).supportedPageSizes(); + QPageSize unavailableSizeToSet; + for (QPageSize s : qAsConst(defaultPageSizes)) { + bool found = false; + for (QPageSize os : qAsConst(otherPageSizes)) { + if (os.isEquivalentTo(s)) { + found = true; + break; + } + } + const QPageSize tmpSize(s.size(QPageSize::Point), QPageSize::Point); + if (!tmpSize.name().startsWith("Custom")) + found = true; + if (!found) { + unavailableSizeToSet = s; + break; + } + } + if (!unavailableSizeToSet.isValid()) + QSKIP("Could not find a size that was not available on the non default printer. The test " + "requires this"); + defaultP.setPageSize(unavailableSizeToSet); + defaultP.setPrinterName(otherP.printerName()); + QVERIFY(defaultP.pageLayout().pageSize().isEquivalentTo(unavailableSizeToSet)); + QVERIFY(defaultP.pageLayout().pageSize().name() != unavailableSizeToSet.name()); + QCOMPARE(defaultP.pageLayout().pageSize().sizePoints(), unavailableSizeToSet.sizePoints()); +} + #endif // QT_CONFIG(printer) QTEST_MAIN(tst_QPrinter) diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 74a2f7f2b6..08597d5eb1 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -3326,7 +3326,7 @@ void tst_QHeaderView::testMinMaxSectionSize(bool stretchLastSection) header.resizeSection(0, sectionSizeMax); QCOMPARE(header.sectionSize(0), sectionSizeMax); header.setMaximumSectionSize(defaultSectionSize); - waitFor([this, &header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; }); + waitFor([&header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; }); QCOMPARE(header.sectionSize(0), defaultSectionSize); // change section size on min change @@ -3335,7 +3335,7 @@ void tst_QHeaderView::testMinMaxSectionSize(bool stretchLastSection) header.resizeSection(0, sectionSizeMin); QCOMPARE(header.sectionSize(0), sectionSizeMin); header.setMinimumSectionSize(defaultSectionSize); - waitFor([this, &header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; }); + waitFor([&header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; }); QCOMPARE(header.sectionSize(0), defaultSectionSize); } |