From 74111ce590ec8b40ee48e828c238bbfb1bf41aaa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Jun 2017 07:51:42 -0700 Subject: Continue to blacklist the utun interfaces on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were two more places that blacklisted certain interface types that commit e579c822c5bedf5e626e4eb72db3b49a4a4015dc didn't catch. This commit adds those two. Task-number: QTBUG-61263 Change-Id: Ia58d0480a9169f0f121aec03bf2e8900a58939cd Reviewed-by: Tony Sarajärvi --- tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp | 7 +++++++ tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index cd1de209da..c4432c83ee 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -938,9 +938,16 @@ void tst_QTcpServer::linkLocal() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not connect to the Teredo Tunneling interface on Windows Xp. if (iface.humanReadableName() == QString("Teredo Tunneling Pseudo-Interface")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addressEntry, iface.addressEntries()) { QHostAddress addr = addressEntry.ip(); if (addr.isInSubnet(localMaskv4, 16)) { diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index b476fdd334..43d0781083 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1638,9 +1638,16 @@ void tst_QUdpSocket::linkLocalIPv4() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not add the Teredo Tunneling Pseudo Interface on Windows. if (iface.humanReadableName().contains("Teredo")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addr, iface.addressEntries()) { if (addr.ip().isInSubnet(localMask, 16)) { addresses << addr.ip(); -- cgit v1.2.3 From 94a2aec05bcd40194354107eb8264bf28cbd2b19 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 3 Jun 2017 14:07:52 +0200 Subject: moc: Don't error out when defining a keyword Normaly, in C++ It's not valid to define a keyword, but it turns out that some system header do, so we just silently accept it. [ChangeLog][moc] moc no longer errors out if a C++ keyword is #define'ed Task-number: QTBUG-61204 Change-Id: Ia4d3ff9c77b6ff261b6140c220cfb81bd13f1d6d Reviewed-by: Thiago Macieira Reviewed-by: Simon Hausmann --- tests/auto/tools/moc/parse-defines.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h index 6100bf67ad..7b0fa29d7c 100644 --- a/tests/auto/tools/moc/parse-defines.h +++ b/tests/auto/tools/moc/parse-defines.h @@ -146,6 +146,15 @@ signals: #undef QString +#ifdef Q_MOC_RUN +// Normaly, redefining keywords is forbidden, but we should not abort parsing +#define and && +#define and_eq &= +#define bitand & +#define true 1 +#undef true +#endif + PD_END_NAMESPACE #endif -- cgit v1.2.3 From 0265a23bb02b68534bb3c86514cc93bc45a7444f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 6 Jun 2017 23:46:06 +0100 Subject: Fix crash when calling QWidget::grab() on a QOpenGLWidget By avoiding unneeded nested QPainters. Crash was: ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239 s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter. Task-number: QTBUG-61036 Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4 Reviewed-by: Friedemann Kleint Reviewed-by: Laszlo Agocs --- tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 5980cb95d0..f51c566f20 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -233,6 +233,8 @@ void tst_QOpenGLWidget::painter() glw->m_clear = true; image = glw->grabFramebuffer(); QVERIFY(image.pixel(20, 10) == qRgb(0, 255, 0)); + + QPixmap pix = glw->grab(); // QTBUG-61036 } void tst_QOpenGLWidget::reparentToAlreadyCreated() -- cgit v1.2.3 From 6a6cdccee43288e2abb6a6e16e4e911062911374 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 7 Jun 2017 08:23:10 +0200 Subject: tst_QSharedMemory::readOnly: Skip on macOS The binary hangs rather than segfaults on that platform. Task-number: QTBUG-59936 Change-Id: Id7d38edb7c746e3c0cd4b4941e0e19b3d42a628a Reviewed-by: Jake Petroules --- tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp index 8833321b4f..3b25000b22 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp @@ -459,6 +459,8 @@ void tst_QSharedMemory::readOnly() { #if !QT_CONFIG(process) QSKIP("No qprocess support", SkipAll); +#elif defined(Q_OS_MACOS) + QSKIP("QTBUG-59936: Times out on macOS", SkipAll); #else rememberKey("readonly_segfault"); // ### on windows disable the popup somehow -- cgit v1.2.3 From 8e776d39ff9fbdf74422ab431a94c0aea6b98cfd Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 23 May 2017 09:46:36 +0200 Subject: Fix tst_qresourceengine for platforms with embedded test data load(resources) makes embedding the test data into the executable fail for platforms that use builtin test data. As the load call is only used to obtain QMAKE_RCC we can avoid that call by assuming that rcc was not renamed and assembling the path ourself. Change-Id: I25b982d10f5617d9a213803e7e4bcc85fc66b2e7 Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qresourceengine/qresourceengine.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro index a39de3c4d5..7676b04a03 100644 --- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro +++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro @@ -1,13 +1,13 @@ CONFIG += testcase TARGET = tst_qresourceengine -load(resources) + QT = core testlib SOURCES = tst_qresourceengine.cpp RESOURCES += testqrc/test.qrc runtime_resource.target = runtime_resource.rcc runtime_resource.depends = $$PWD/testqrc/test.qrc -runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} +runtime_resource.commands = $$[QT_INSTALL_BINS]/rcc -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} QMAKE_EXTRA_TARGETS = runtime_resource PRE_TARGETDEPS += $${runtime_resource.target} QMAKE_DISTCLEAN += $${runtime_resource.target} -- cgit v1.2.3 From 5441f399af7880f3957751d1601354aaec802666 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 11 May 2017 11:50:11 +0200 Subject: Fix tst_QDir::emptyDir It is possible that tmpdir already exists as a leftover from previous tests. That is no reason for the test to fail. Change-Id: I010633fb92defb064093af9872ae6fd2178f07dd Reviewed-by: Friedemann Kleint Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 946620d61f..da948849f6 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -2322,8 +2322,11 @@ void tst_QDir::cdBelowRoot() void tst_QDir::emptyDir() { const QString tempDir = QDir::currentPath() + "/tmpdir/"; - QVERIFY(QDir().mkdir(tempDir)); - QVERIFY(QDir(tempDir).mkdir("emptyDirectory")); + QDir temp(tempDir); + if (!temp.exists()) { + QVERIFY(QDir().mkdir(tempDir)); + } + QVERIFY(temp.mkdir("emptyDirectory")); QDir testDir(tempDir + "emptyDirectory"); QVERIFY(testDir.isEmpty()); -- cgit v1.2.3 From 147aa291620d9e2533bbea536a748a8f8a7ed14b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 5 May 2017 16:57:56 +0100 Subject: Fix sending UTC-offset QTimeZones through QDataStream QTimeZone("UTC") should be valid, as "UTC" appears in the list of availableTimeZoneIds(), and tst_QTimeZone::dataStreamTest() constructs timezones like this, which are considered valid. The internal representation of a QTimeZone("UTC") as created by QTimeZone::QTimeZone(const QByteArray &ianaId) is a QUtcTimeZonePrivate which isValid(), so the containing QTimeZone isValid() too. When QTimeZone is serialized into a QDataStream, it calls tz.d->serialize(ds) which is QUtcTimeZonePrivate::serialize. This writes QStringLiteral("OffsetFromUtc") followed by the IANA ID and the offset (etc.) to the datastream. When QTimeZone is deserialized it looks for this marker string, and if present, it passed all of the parameters to the QTimeZone constructor (not just the name). However, that constructor does not support standard IANA timezones (only custom ones), and when it detects that the supplied IANA ID is actually listed in availableTimeZoneIds(), it leaves the pointer to the QTimeZonePrivate uninitialized (NULL), which leaves the QTimeZone invalid (isValid() returns false). Thus, a valid timezone which was serialized and then deserialized has become invalid. This also affects serialization of QDateTimes with timezones. Fixed by calling the name-only constructor first, which works (only) for IANA standard timezones and leaves the QTimeZone invalid (isValid() returns false) otherwise. In which case, we can call the many-argument contructor to create a custom timezone with the same offset as the one which was originally serialized. [ChangeLog][QtCore][QTimeZone] Fixed sending IANA standard UTC-offset QTimeZones through QDataStream, which previously came out invalid after deserialization. Task-number: QTBUG-60595 Change-Id: Id9c47e8bda701faae4d800e012afb6db545b2fe9 Reviewed-by: Oswald Buddenhagen Reviewed-by: Edward Welbourne --- tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp index c1f2822b74..e75ed5cc67 100644 --- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp @@ -299,7 +299,7 @@ void tst_QTimeZone::nullTest() void tst_QTimeZone::dataStreamTest() { - // Test the OffsetFromUtc backend serialization + // Test the OffsetFromUtc backend serialization. First with a custom timezone: QTimeZone tz1("QST", 123456, "Qt Standard Time", "QST", QLocale::Norway, "Qt Testing"); QByteArray tmp; { @@ -321,6 +321,20 @@ void tst_QTimeZone::dataStreamTest() QString("Qt Standard Time")); QCOMPARE(tz2.offsetFromUtc(QDateTime::currentDateTime()), 123456); + // And then with a standard IANA timezone (QTBUG-60595): + tz1 = QTimeZone("UTC"); + QCOMPARE(tz1.isValid(), true); + { + QDataStream ds(&tmp, QIODevice::WriteOnly); + ds << tz1; + } + { + QDataStream ds(&tmp, QIODevice::ReadOnly); + ds >> tz2; + } + QCOMPARE(tz2.isValid(), true); + QCOMPARE(tz2.id(), tz1.id()); + // Test the system backend serialization tz1 = QTimeZone("Pacific/Auckland"); -- cgit v1.2.3 From b598cd0483d28282179ab46cb27e42d44b8f2b7b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 7 Jun 2017 13:51:52 +0200 Subject: Ignore test failures of linkLocalIPv6 on RHEL 6.6 in the CI The test fails as sendmsg() on the socket trying to deliver a packet to the IPv6 link-local fe80 address returns with -ENETDOWN. I cannot figure out why this happens when RHEL 6.6 is run under qemu/kvm but not under vmware. More details are in the task, but meanwhile the result of this test is ignored. This affects only RHEL 6.6, it passes on RHEL 7.2. Change-Id: I4ade5cd249dd0d1901368ab571dad324e0fd10c2 Task-number: QTQAINFRA-1042 Reviewed-by: Frederik Gladhorn --- tests/auto/network/socket/qudpsocket/BLACKLIST | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index 6669b094ce..cf25c96fd8 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -25,4 +25,5 @@ osx osx [zeroLengthDatagram] osx - +[linkLocalIPv6] +redhatenterpriselinuxworkstation-6.6 -- cgit v1.2.3 From 9205110cfe84204c0f8eb2b90f42e9131d27108e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Jun 2017 09:05:02 +0200 Subject: Refactor tst_QStyleSheetStyle::focus/hoverColors() - Put all widgets in one dialog so that show/setActive occurs only once. - Use the center of the widget geometry for positioning. - Remove BypassWindowManagerHint which likely causes qWaitForWindowActive() to fail. - Move the cursor out of the way and subsequently send mouse events to the QWindow Task-number: QTBUG-51400 Change-Id: I2176d8dbaead72d7a6fa89aa769e4c804eea7a0c Reviewed-by: Qt CI Bot Reviewed-by: Simon Hausmann --- .../qstylesheetstyle/tst_qstylesheetstyle.cpp | 119 ++++++++++++--------- 1 file changed, 69 insertions(+), 50 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index d8c70a0cc1..693b0b8aee 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -817,22 +817,45 @@ static bool testForColors(const QImage& image, const QColor& color, bool ensureP return false; } -static const QList sample_widgets() // returning const to avoid detaching when passing to range-for +class TestDialog : public QDialog { +public: + explicit TestDialog(const QString &styleSheet); + + QWidgetList widgets() const { return m_widgets; } + QLineEdit *focusDummy() const { return m_focusDummy; } + +private: + void addWidget(QWidget *w) + { + w->setStyleSheet(m_styleSheet); + m_layout->addWidget(w); + m_widgets.append(w); + } + + const QString m_styleSheet; + QVBoxLayout* m_layout; + QLineEdit *m_focusDummy; + QWidgetList m_widgets; +}; + +TestDialog::TestDialog(const QString &styleSheet) : + m_styleSheet(styleSheet), + m_layout(new QVBoxLayout(this)), + m_focusDummy(new QLineEdit) { - QList widgets; - widgets << new QPushButton("TESTING TESTING"); - widgets << new QLineEdit("TESTING TESTING"); - widgets << new QLabel("TESTING TESTING"); + m_layout->addWidget(m_focusDummy); // Avoids initial focus. + addWidget(new QPushButton("TESTING TESTING")); + addWidget(new QLineEdit("TESTING TESTING")); + addWidget(new QLabel("TESTING TESTING")); QSpinBox *spinbox = new QSpinBox; spinbox->setMaximum(1000000000); spinbox->setValue(123456789); - widgets << spinbox; + addWidget(spinbox); QComboBox *combobox = new QComboBox; combobox->setEditable(true); combobox->addItems(QStringList() << "TESTING TESTING"); - widgets << combobox; - widgets << new QLabel("TESTING TESTING"); - return widgets; + addWidget(spinbox); + addWidget(new QLabel("TESTING TESTING")); } void tst_QStyleSheetStyle::focusColors() @@ -852,28 +875,21 @@ void tst_QStyleSheetStyle::focusColors() "That doesn't mean that the feature doesn't work in practice."); #endif + TestDialog frame(QStringLiteral("*:focus { border:none; background: #e8ff66; color: #ff0084 }")); + frame.setWindowTitle(QTest::currentTestFunction()); - for (QWidget *widget : sample_widgets()) { - QDialog frame; - QLayout* layout = new QGridLayout; - - QLineEdit* dummy = new QLineEdit; // Avoids initial focus. - - widget->setStyleSheet("*:focus { border:none; background: #e8ff66; color: #ff0084 }"); + centerOnScreen(&frame); + frame.show(); - layout->addWidget(dummy); - layout->addWidget(widget); - frame.setLayout(layout); + QApplication::setActiveWindow(&frame); + QVERIFY(QTest::qWaitForWindowActive(&frame)); - centerOnScreen(&frame); - frame.show(); - QApplication::setActiveWindow(&frame); - QVERIFY(QTest::qWaitForWindowActive(&frame)); + for (QWidget *widget : frame.widgets()) { widget->setFocus(); QApplication::processEvents(); - QImage image(frame.width(), frame.height(), QImage::Format_ARGB32); - frame.render(&image); + QImage image(widget->width(), widget->height(), QImage::Format_ARGB32); + widget->render(&image); if (image.depth() < 24) QSKIP("Test doesn't support color depth < 24"); @@ -896,32 +912,35 @@ void tst_QStyleSheetStyle::hoverColors() #ifdef Q_OS_OSX QSKIP("This test is fragile on Mac, most likely due to QTBUG-33959."); #endif + TestDialog frame(QStringLiteral("*:hover { border:none; background: #e8ff66; color: #ff0084 }")); + frame.setWindowTitle(QTest::currentTestFunction()); - for (QWidget *widget : sample_widgets()) { - //without Qt::X11BypassWindowManagerHint the window manager may move the window after we moved the cursor - QDialog frame(0, Qt::X11BypassWindowManagerHint); - QLayout* layout = new QGridLayout; - - QLineEdit* dummy = new QLineEdit; + centerOnScreen(&frame); + // Move the mouse cursor out of the way to suppress spontaneous QEvent::Enter + // events interfering with QApplicationPrivate::dispatchEnterLeave(). + // Mouse events can then be sent directly to the QWindow instead of the + // QWidget, triggering the enter/leave handling within the dialog window, + // speeding up the test. + QCursor::setPos(frame.geometry().topLeft() - QPoint(100, 0)); + frame.show(); - widget->setStyleSheet("*:hover { border:none; background: #e8ff66; color: #ff0084 }"); + QApplication::setActiveWindow(&frame); + QVERIFY(QTest::qWaitForWindowActive(&frame)); - layout->addWidget(dummy); - layout->addWidget(widget); - frame.setLayout(layout); + QWindow *frameWindow = frame.windowHandle(); + QVERIFY(frameWindow); - centerOnScreen(&frame); - frame.show(); + const QPoint dummyPos = frame.focusDummy()->geometry().center(); + QTest::mouseMove(frameWindow, dummyPos); - QApplication::setActiveWindow(&frame); - QVERIFY(QTest::qWaitForWindowActive(&frame)); + for (QWidget *widget : frame.widgets()) { //move the mouse inside the widget, it should be colored - QTest::mouseMove ( widget, QPoint(6,6)); + const QRect widgetGeometry = widget->geometry(); + QTest::mouseMove(frameWindow, widgetGeometry.center()); + QTRY_VERIFY2(widget->testAttribute(Qt::WA_UnderMouse), widget->metaObject()->className()); - QTRY_VERIFY(widget->testAttribute(Qt::WA_UnderMouse)); - - QImage image(frame.width(), frame.height(), QImage::Format_ARGB32); - frame.render(&image); + QImage image(widgetGeometry.size(), QImage::Format_ARGB32); + widget->render(&image); QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) @@ -931,10 +950,10 @@ void tst_QStyleSheetStyle::hoverColors() + " did not contain text color #ff0084").toLocal8Bit().constData()); //move the mouse outside the widget, it should NOT be colored - QTest::mouseMove ( dummy, QPoint(5,5)); - QTest::qWait(60); + QTest::mouseMove(frameWindow, dummyPos); + QTRY_VERIFY2(frame.focusDummy()->testAttribute(Qt::WA_UnderMouse), "FocusDummy"); - frame.render(&image); + widget->render(&image); QVERIFY2(!testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) @@ -944,10 +963,10 @@ void tst_QStyleSheetStyle::hoverColors() + " did contain text color #ff0084").toLocal8Bit().constData()); //move the mouse again inside the widget, it should be colored - QTest::mouseMove (widget, QPoint(5,5)); - QTRY_VERIFY(widget->testAttribute(Qt::WA_UnderMouse)); + QTest::mouseMove (frameWindow, widgetGeometry.center()); + QTRY_VERIFY2(widget->testAttribute(Qt::WA_UnderMouse), widget->metaObject()->className()); - frame.render(&image); + widget->render(&image); QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) -- cgit v1.2.3 From 26fd805f500acfdcf730f2488a66e18c72d0ff9a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 30 May 2017 21:45:23 +0200 Subject: macOS/iOS: Correctly ignore punctuation in QCollator When punctuation is ignored then the kUCCollatePunctionSignificantMask should not be set. This was originally thought to not be working due to a bug on the Apple platforms, but this is not the case. [ChangeLog][Platform Specific Changes][macOS][iOS] QCollator now respects the ignorePunctuation property on Apple based platforms correctly. Task-number: QTBUG-41978 Change-Id: I62044076387d6e4479f4aaef3c2f48f49dbd160e Reviewed-by: Lars Knoll --- .../auto/corelib/tools/qcollator/tst_qcollator.cpp | 84 ++++++++++++++-------- 1 file changed, 55 insertions(+), 29 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index d09910fd5c..35a9af05f6 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -30,6 +30,7 @@ #include #include +#include #include @@ -88,6 +89,8 @@ void tst_QCollator::compare_data() QTest::addColumn("result"); QTest::addColumn("caseInsensitiveResult"); QTest::addColumn("numericMode"); + QTest::addColumn("ignorePunctuation"); + QTest::addColumn("punctuationResult"); /* A few tests below are commented out on the mac. It's unclear why they fail, @@ -102,55 +105,72 @@ void tst_QCollator::compare_data() comparison of Latin-1 values, although I'm not sure. So I just test digits to make sure that it's not totally broken. */ - QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1 << false; - QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1 << false; - QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1 << false; - QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1 << false; - QTest::newRow("english5") << QString("en_US") << QString("test 9") << QString("test 19") << -1 << -1 << true; + QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1 << false << false << 1; + QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1 << false << false << -1; + QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1 << false << false << -1; + QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1 << false << false << -1; + QTest::newRow("english5") << QString("en_US") << QString("test 9") << QString("test 19") << -1 << -1 << true << false << -1; + QTest::newRow("english6") << QString("en_US") << QString("test 9") << QString("test_19") << -1 << -1 << true << true << -1; + QTest::newRow("english7") << QString("en_US") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("english8") << QString("en_US") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* In Swedish, a with ring above (E5) comes before a with diaresis (E4), which comes before o diaresis (F6), which all come after z. */ - QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1 << false; - QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("swedish5") << QString("sv_SE") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1 << false << false << -1; + QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("swedish5") << QString("sv_SE") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("swedish6") << QString("sv_SE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("swedish7") << QString("sv_SE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("swedish8") << QString("sv_SE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + /* In Norwegian, ae (E6) comes before o with stroke (D8), which comes before a with ring above (E5). */ - QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1 << false; - QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("norwegian4") << QString("no_NO") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian4") << QString("no_NO") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("norwegian5") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("norwegian6") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("norwegian7") << QString("no_NO") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("norwegian8") << QString("no_NO") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* In German, z comes *after* a with diaresis (E4), which comes before o diaresis (F6). */ - QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1 << false; - QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1 << false; - QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1 << false; - QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1 << false; - QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0 << false; - QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0 << false; - QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1 << false; - QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0 << false; - QTest::newRow("german10") << QString("de_DE") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1 << false << false << -1; + QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1 << false << false << 1; + QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1 << false << false << 1; + QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1 << false << false << 1; + QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0 << false << false << 0; + QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0 << false << false << 0; + QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1 << false << false << 1; + QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0 << false << false << 0; + QTest::newRow("german10") << QString("de_DE") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("german11") << QString("de_DE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("german12") << QString("de_DE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("german13") << QString("de_DE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* French sorting of e and e with accent */ - QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false; - QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false; - QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1 << false; - QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1 << false; - QTest::newRow("french5") << QString("fr_FR") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false << false << 1; + QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false << false << 1; + QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1 << false << false << 1; + QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1 << false << false << -1; + QTest::newRow("french5") << QString("fr_FR") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("french6") << QString("fr_FR") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("french7") << QString("fr_FR") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("french8") << QString("fr_FR") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; } @@ -162,6 +182,8 @@ void tst_QCollator::compare() QFETCH(int, result); QFETCH(int, caseInsensitiveResult); QFETCH(bool, numericMode); + QFETCH(bool, ignorePunctuation); + QFETCH(int, punctuationResult); QCollator collator(locale); @@ -176,6 +198,10 @@ void tst_QCollator::compare() QCOMPARE(collator.compare(s1, s2), result); collator.setCaseSensitivity(Qt::CaseInsensitive); QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); +#if !QT_CONFIG(iconv) + collator.setIgnorePunctuation(ignorePunctuation); + QCOMPARE(collator.compare(s1, s2), punctuationResult); +#endif } -- cgit v1.2.3 From 65a317e6745ee267bef7295f4dfe31d5ec62f7aa Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Sun, 11 Jun 2017 18:41:57 +0200 Subject: Use QMap in QProcessEnvironment so variables are sorted The motivation for this change is to make it simple to pass a correctly sorted environment block to Win32 CreateProcess(). It is also nice in other contexts that the environment variables are sorted. The change is made for all platforms. This keeps it simple and the only ill effect is slightly slower lookups. Concerning the environment block passed to Win32 CreateProcess: The environment block that is passed to CreateProcess() must be sorted case-insensitively and without regard to locale. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx The need for sorting the environment block is also mentioned in the CreateProcess() documentation, but with less details: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx Task-number: QTBUG-61315 Change-Id: Ie1edd443301de79cf5f699d45beab01b7c0f9de3 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 0783a65d8b..f4d6d5cb40 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -94,6 +94,7 @@ private slots: void setEnvironment(); void setProcessEnvironment_data(); void setProcessEnvironment(); + void environmentIsSorted(); void spaceInName(); void setStandardInputFile(); void setStandardOutputFile_data(); @@ -1733,6 +1734,47 @@ void tst_QProcess::setProcessEnvironment() } } +void tst_QProcess::environmentIsSorted() +{ + QProcessEnvironment env; + env.insert(QLatin1String("a"), QLatin1String("foo_a")); + env.insert(QLatin1String("B"), QLatin1String("foo_B")); + env.insert(QLatin1String("c"), QLatin1String("foo_c")); + env.insert(QLatin1String("D"), QLatin1String("foo_D")); + env.insert(QLatin1String("e"), QLatin1String("foo_e")); + env.insert(QLatin1String("F"), QLatin1String("foo_F")); + env.insert(QLatin1String("Path"), QLatin1String("foo_Path")); + env.insert(QLatin1String("SystemRoot"), QLatin1String("foo_SystemRoot")); + + const QStringList envlist = env.toStringList(); + +#ifdef Q_OS_WIN32 + // The environment block passed to CreateProcess "[Requires that] All strings in the + // environment block must be sorted alphabetically by name. The sort is case-insensitive, + // Unicode order, without regard to locale." + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx + // So on Windows we sort that way. + const QStringList expected = { QLatin1String("a=foo_a"), + QLatin1String("B=foo_B"), + QLatin1String("c=foo_c"), + QLatin1String("D=foo_D"), + QLatin1String("e=foo_e"), + QLatin1String("F=foo_F"), + QLatin1String("Path=foo_Path"), + QLatin1String("SystemRoot=foo_SystemRoot") }; +#else + const QStringList expected = { QLatin1String("B=foo_B"), + QLatin1String("D=foo_D"), + QLatin1String("F=foo_F"), + QLatin1String("Path=foo_Path"), + QLatin1String("SystemRoot=foo_SystemRoot"), + QLatin1String("a=foo_a"), + QLatin1String("c=foo_c"), + QLatin1String("e=foo_e") }; +#endif + QCOMPARE(envlist, expected); +} + void tst_QProcess::systemEnvironment() { QVERIFY(!QProcess::systemEnvironment().isEmpty()); -- cgit v1.2.3 From 73f8b605e3354f1ab85f36c8d20bdf0de2b1f74e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 2 Jun 2017 11:28:31 +0200 Subject: uic: Fix possible crash when reading the size hint property It may crash on (probably a bit broken) qtbase/src/printsupport/dialogs/qpagesetupwidget.ui Change-Id: Ibca95a3d8aa4899adbc952aee7b46621ac888c6a Reviewed-by: Friedemann Kleint --- tests/auto/tools/uic/baseline/qpagesetupwidget.ui | 181 +++++++++++++-------- .../auto/tools/uic/baseline/qpagesetupwidget.ui.h | 139 ++++++++++------ 2 files changed, 203 insertions(+), 117 deletions(-) (limited to 'tests') diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui index ace2ab8f44..960a9dac17 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui @@ -6,7 +6,7 @@ 0 0 416 - 488 + 515 @@ -16,44 +16,24 @@ 0 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - + + + Paper - - - - + + + + Page size: - - paperSize + + pageSizeCombo - + @@ -61,14 +41,14 @@ Width: - paperWidth + pageWidth - + 9999.989999999999782 @@ -80,12 +60,12 @@ Height: - paperHeight + pageHeight - + 9999.989999999999782 @@ -122,9 +102,32 @@ - - - + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Orientation @@ -175,12 +178,9 @@ - - - - - - + + + Margins @@ -280,9 +280,25 @@ - - - + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 20 + + + + + + + bottom margin @@ -296,28 +312,15 @@ - - - + + + Qt::Horizontal QSizePolicy::MinimumExpanding - - - 0 - 20 - - - - - - - - Qt::Horizontal - - + QSizePolicy::MinimumExpanding @@ -333,15 +336,57 @@ - - - + + + + Page Layout + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Page order: + + + + + + + + + + Pages per sheet: + + + + + + + + + Qt::Vertical 20 - 0 + 40 diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h index 0c6fc92ea2..d75f7f1146 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qpagesetupwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.9.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -31,21 +31,22 @@ class Ui_QPageSetupWidget { public: QGridLayout *gridLayout_3; - QHBoxLayout *horizontalLayout_4; - QComboBox *unit; - QSpacerItem *horizontalSpacer_3; QGroupBox *groupBox_2; QGridLayout *gridLayout_2; QLabel *pageSizeLabel; - QComboBox *paperSize; + QComboBox *pageSizeCombo; QLabel *widthLabel; QHBoxLayout *horizontalLayout_3; - QDoubleSpinBox *paperWidth; + QDoubleSpinBox *pageWidth; QLabel *heightLabel; - QDoubleSpinBox *paperHeight; + QDoubleSpinBox *pageHeight; QLabel *paperSourceLabel; QComboBox *paperSource; QSpacerItem *horizontalSpacer_4; + QHBoxLayout *horizontalLayout_4; + QComboBox *unitCombo; + QSpacerItem *horizontalSpacer_3; + QWidget *preview; QGroupBox *groupBox_3; QVBoxLayout *verticalLayout; QRadioButton *portrait; @@ -53,7 +54,6 @@ public: QRadioButton *reverseLandscape; QRadioButton *reversePortrait; QSpacerItem *verticalSpacer_5; - QWidget *preview; QGroupBox *groupBox; QHBoxLayout *horizontalLayout_2; QGridLayout *gridLayout; @@ -64,33 +64,26 @@ public: QSpacerItem *horizontalSpacer; QDoubleSpinBox *rightMargin; QSpacerItem *horizontalSpacer_8; - QDoubleSpinBox *bottomMargin; QSpacerItem *horizontalSpacer_2; + QDoubleSpinBox *bottomMargin; QSpacerItem *horizontalSpacer_5; + QGroupBox *pagesPerSheetButtonGroup; + QGridLayout *gridLayout_4; + QComboBox *pagesPerSheetCombo; + QSpacerItem *horizontalSpacer_6; + QLabel *label; + QComboBox *pagesPerSheetLayoutCombo; + QLabel *label_2; QSpacerItem *verticalSpacer; void setupUi(QWidget *QPageSetupWidget) { if (QPageSetupWidget->objectName().isEmpty()) QPageSetupWidget->setObjectName(QStringLiteral("QPageSetupWidget")); - QPageSetupWidget->resize(416, 488); + QPageSetupWidget->resize(416, 515); gridLayout_3 = new QGridLayout(QPageSetupWidget); gridLayout_3->setContentsMargins(0, 0, 0, 0); gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); - unit = new QComboBox(QPageSetupWidget); - unit->setObjectName(QStringLiteral("unit")); - - horizontalLayout_4->addWidget(unit); - - horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_4->addItem(horizontalSpacer_3); - - - gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2); - groupBox_2 = new QGroupBox(QPageSetupWidget); groupBox_2->setObjectName(QStringLiteral("groupBox_2")); gridLayout_2 = new QGridLayout(groupBox_2); @@ -100,10 +93,10 @@ public: gridLayout_2->addWidget(pageSizeLabel, 0, 0, 1, 1); - paperSize = new QComboBox(groupBox_2); - paperSize->setObjectName(QStringLiteral("paperSize")); + pageSizeCombo = new QComboBox(groupBox_2); + pageSizeCombo->setObjectName(QStringLiteral("pageSizeCombo")); - gridLayout_2->addWidget(paperSize, 0, 1, 1, 1); + gridLayout_2->addWidget(pageSizeCombo, 0, 1, 1, 1); widthLabel = new QLabel(groupBox_2); widthLabel->setObjectName(QStringLiteral("widthLabel")); @@ -112,22 +105,22 @@ public: horizontalLayout_3 = new QHBoxLayout(); horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); - paperWidth = new QDoubleSpinBox(groupBox_2); - paperWidth->setObjectName(QStringLiteral("paperWidth")); - paperWidth->setMaximum(9999.99); + pageWidth = new QDoubleSpinBox(groupBox_2); + pageWidth->setObjectName(QStringLiteral("pageWidth")); + pageWidth->setMaximum(9999.99); - horizontalLayout_3->addWidget(paperWidth); + horizontalLayout_3->addWidget(pageWidth); heightLabel = new QLabel(groupBox_2); heightLabel->setObjectName(QStringLiteral("heightLabel")); horizontalLayout_3->addWidget(heightLabel); - paperHeight = new QDoubleSpinBox(groupBox_2); - paperHeight->setObjectName(QStringLiteral("paperHeight")); - paperHeight->setMaximum(9999.99); + pageHeight = new QDoubleSpinBox(groupBox_2); + pageHeight->setObjectName(QStringLiteral("pageHeight")); + pageHeight->setMaximum(9999.99); - horizontalLayout_3->addWidget(paperHeight); + horizontalLayout_3->addWidget(pageHeight); gridLayout_2->addLayout(horizontalLayout_3, 1, 1, 1, 1); @@ -149,6 +142,25 @@ public: gridLayout_3->addWidget(groupBox_2, 1, 0, 1, 2); + horizontalLayout_4 = new QHBoxLayout(); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); + unitCombo = new QComboBox(QPageSetupWidget); + unitCombo->setObjectName(QStringLiteral("unitCombo")); + + horizontalLayout_4->addWidget(unitCombo); + + horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout_4->addItem(horizontalSpacer_3); + + + gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2); + + preview = new QWidget(QPageSetupWidget); + preview->setObjectName(QStringLiteral("preview")); + + gridLayout_3->addWidget(preview, 2, 1, 2, 1); + groupBox_3 = new QGroupBox(QPageSetupWidget); groupBox_3->setObjectName(QStringLiteral("groupBox_3")); verticalLayout = new QVBoxLayout(groupBox_3); @@ -181,11 +193,6 @@ public: gridLayout_3->addWidget(groupBox_3, 2, 0, 1, 1); - preview = new QWidget(QPageSetupWidget); - preview->setObjectName(QStringLiteral("preview")); - - gridLayout_3->addWidget(preview, 2, 1, 2, 1); - groupBox = new QGroupBox(QPageSetupWidget); groupBox->setObjectName(QStringLiteral("groupBox")); horizontalLayout_2 = new QHBoxLayout(groupBox); @@ -230,6 +237,10 @@ public: gridLayout->addLayout(horizontalLayout, 1, 0, 1, 3); + horizontalSpacer_2 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_2, 0, 2, 1, 1); + bottomMargin = new QDoubleSpinBox(groupBox); bottomMargin->setObjectName(QStringLiteral("bottomMargin")); bottomMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); @@ -237,10 +248,6 @@ public: gridLayout->addWidget(bottomMargin, 2, 1, 1, 1); - horizontalSpacer_2 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_2, 0, 2, 1, 1); - horizontalSpacer_5 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); gridLayout->addItem(horizontalSpacer_5, 0, 0, 1, 1); @@ -251,14 +258,45 @@ public: gridLayout_3->addWidget(groupBox, 3, 0, 1, 1); - verticalSpacer = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); + pagesPerSheetButtonGroup = new QGroupBox(QPageSetupWidget); + pagesPerSheetButtonGroup->setObjectName(QStringLiteral("pagesPerSheetButtonGroup")); + gridLayout_4 = new QGridLayout(pagesPerSheetButtonGroup); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + pagesPerSheetCombo = new QComboBox(pagesPerSheetButtonGroup); + pagesPerSheetCombo->setObjectName(QStringLiteral("pagesPerSheetCombo")); + + gridLayout_4->addWidget(pagesPerSheetCombo, 0, 1, 1, 1); + + horizontalSpacer_6 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_4->addItem(horizontalSpacer_6, 0, 2, 1, 1); + + label = new QLabel(pagesPerSheetButtonGroup); + label->setObjectName(QStringLiteral("label")); + + gridLayout_4->addWidget(label, 1, 0, 1, 1); + + pagesPerSheetLayoutCombo = new QComboBox(pagesPerSheetButtonGroup); + pagesPerSheetLayoutCombo->setObjectName(QStringLiteral("pagesPerSheetLayoutCombo")); + + gridLayout_4->addWidget(pagesPerSheetLayoutCombo, 1, 1, 1, 1); + + label_2 = new QLabel(pagesPerSheetButtonGroup); + label_2->setObjectName(QStringLiteral("label_2")); + + gridLayout_4->addWidget(label_2, 0, 0, 1, 1); + + + gridLayout_3->addWidget(pagesPerSheetButtonGroup, 5, 0, 1, 2); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(verticalSpacer, 4, 0, 1, 1); + gridLayout_3->addItem(verticalSpacer, 6, 0, 1, 1); #ifndef QT_NO_SHORTCUT - pageSizeLabel->setBuddy(paperSize); - widthLabel->setBuddy(paperWidth); - heightLabel->setBuddy(paperHeight); + pageSizeLabel->setBuddy(pageSizeCombo); + widthLabel->setBuddy(pageWidth); + heightLabel->setBuddy(pageHeight); paperSourceLabel->setBuddy(paperSource); #endif // QT_NO_SHORTCUT @@ -305,6 +343,9 @@ public: #ifndef QT_NO_ACCESSIBILITY bottomMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "bottom margin", Q_NULLPTR)); #endif // QT_NO_ACCESSIBILITY + pagesPerSheetButtonGroup->setTitle(QApplication::translate("QPageSetupWidget", "Page Layout", Q_NULLPTR)); + label->setText(QApplication::translate("QPageSetupWidget", "Page order:", Q_NULLPTR)); + label_2->setText(QApplication::translate("QPageSetupWidget", "Pages per sheet:", Q_NULLPTR)); } // retranslateUi }; -- cgit v1.2.3 From 24decb49d6c53afa866644bbfb62bcde30cfe8fc Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 24 May 2017 10:46:07 +0200 Subject: winrt: Fix tst_QImageReader Change-Id: I3a7db49329d8f1677c17267f5878d5144ad37823 Reviewed-by: Friedemann Kleint --- tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 18649b3de5..19948edcdf 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -193,7 +193,7 @@ void tst_QImageReader::getSetCheck() } tst_QImageReader::tst_QImageReader() : - m_temporaryDir(QStringLiteral("tst_qimagereaderXXXXXX")) + m_temporaryDir(QDir::tempPath() + QStringLiteral("/tst_qimagereaderXXXXXX")) { m_temporaryDir.setAutoRemove(true); } -- cgit v1.2.3 From 876aed331d7c6d7df81da1dace73dea49176ad1e Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 24 May 2017 10:45:37 +0200 Subject: Fix tst_QIcon for configurations with builtin_testdata Change-Id: Ibf9fcf7d3a8d58c9c488637a45985593950defaf Reviewed-by: Simon Hausmann --- tests/auto/gui/image/qicon/qicon.pro | 2 +- tests/auto/gui/image/qicon/tst_qicon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro index f5570c2497..b3c60bf32b 100644 --- a/tests/auto/gui/image/qicon/qicon.pro +++ b/tests/auto/gui/image/qicon/qicon.pro @@ -4,6 +4,6 @@ TARGET = tst_qicon QT += testlib qtHaveModule(widgets): QT += widgets SOURCES += tst_qicon.cpp -RESOURCES = tst_qicon.qrc +RESOURCES = tst_qicon.qrc tst_qicon.cpp TESTDATA += icons/* second_icons/* *.png *.svg *.svgz diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index e031ffec71..175179699d 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -83,7 +83,7 @@ bool tst_QIcon::haveImageFormat(QByteArray const& desiredFormat) tst_QIcon::tst_QIcon() : m_pngImageFileName(QFINDTESTDATA("image.png")) , m_pngRectFileName(QFINDTESTDATA("rect.png")) - , m_sourceFileName(QFINDTESTDATA(__FILE__)) + , m_sourceFileName(":/tst_qicon.cpp") { } -- cgit v1.2.3 From 64a3ca56d78071aa328f35445f3564edbf0d1fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Tue, 13 Jun 2017 11:14:34 +0300 Subject: Blacklist flaky tst_QMdiArea test Task-number: QTBUG-61381 Change-Id: I5f47315b32b74245479b73297f64944ac929c2b6 Reviewed-by: Liang Qi --- tests/auto/widgets/widgets/qmdiarea/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST index 63da2e3ae3..b1c8d7dfde 100644 --- a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST +++ b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST @@ -3,3 +3,5 @@ osx [tileSubWindows] osx xcb +[resizeTimer] +osx -- cgit v1.2.3 From 79a77f7def676c557792fb871df3f36a86a3fa5f Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Mon, 12 Jun 2017 18:56:16 -0700 Subject: Manual dialog test: fix use custom directory icon option setting In FileDialogPanel::options(), QFileDialog::DontUseCustomDirectoryIcons was set when the "Don't use custom directory icons" box wasn't checked. Change-Id: I6e9d9b41cf91f4abcc98c02bed44675908a8391d Reviewed-by: Friedemann Kleint --- tests/manual/dialogs/filedialogpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index ff935f5280..9e3c761cff 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -300,7 +300,7 @@ QFileDialog::Options FileDialogPanel::options() const result |= QFileDialog::DontConfirmOverwrite; if (!m_native->isChecked()) result |= QFileDialog::DontUseNativeDialog; - if (!m_customDirIcons->isChecked()) + if (m_customDirIcons->isChecked()) result |= QFileDialog::DontUseCustomDirectoryIcons; return result; } -- cgit v1.2.3 From 36f21c5b560c3036e3e74db8669e8eb0fb14b445 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 14 Jun 2017 11:00:29 +0200 Subject: Blacklist tst_QWidget::restoreVersion1Geometry for XCB FAIL! : tst_QWidget::restoreVersion1Geometry(geometry.dat) Compared values are not the same Actual (((widget.pos()))): QPoint(90,90) Expected (expectedPosition): QPoint(100,100) Loc: [tst_qwidget.cpp(3193)] Remove the previously added QSKIP since this test now passes. Task-number: QTBUG-26421 Task-number: QTBUG-46116 Change-Id: Ieff474a8a69c14a0df231a9a587aee02df4e8ea7 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 46791ff884..01c8e783ad 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -7,7 +7,7 @@ ubuntu-14.04 ubuntu-16.04 b2qt [restoreVersion1Geometry] -ubuntu-14.04 +xcb osx [updateWhileMinimized] ubuntu-14.04 diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 0933dc991d..2b6dc5f7e1 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -3195,9 +3195,6 @@ void tst_QWidget::restoreVersion1Geometry() widget.showNormal(); QTest::qWait(10); - if (m_platform == QStringLiteral("xcb")) - QSKIP("QTBUG-26421"); - if (expectedWindowState != Qt::WindowNoState) { // restoring from maximized or fullscreen, we can only restore to the normal geometry QTRY_COMPARE(widget.geometry(), expectedNormalGeometry); -- cgit v1.2.3 From 8875e283720e4c9ac46d63392db9c9b44edf1d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 25 May 2017 22:41:01 +0300 Subject: Blacklist flaky tst_QTimeLine tests on macOS 10.12 Task-number: QTBUG-61037 Change-Id: I604bbc815c16a5ab436d2ff4936d96d3a2d27dab Reviewed-by: J-P Nurmi --- tests/auto/corelib/tools/qtimeline/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST index b5861756d8..74f84a4a6d 100644 --- a/tests/auto/corelib/tools/qtimeline/BLACKLIST +++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST @@ -1,4 +1,7 @@ [interpolation] windows +osx-10.12 [duration] windows +[frameRate] +osx-10.12 -- cgit v1.2.3 From 603963e07d063e3c31c759007a556740e6bb89a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Fri, 26 May 2017 10:09:11 +0300 Subject: Extend blacklisting of tst_QElapsedTimer::elapsed to cover macOS 10.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-58713 Change-Id: I0c467c1abcdd1284910e0a61f98646e943eae377 Reviewed-by: Tony Sarajärvi Reviewed-by: J-P Nurmi --- tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST index f6a49f032c..4cd3c2f0c8 100644 --- a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST @@ -1,2 +1,3 @@ [elapsed] windows +osx-10.12 -- cgit v1.2.3 From da8701ff57c24127a81bf7c8c61bc09e6a214c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Wed, 31 May 2017 15:32:47 +0300 Subject: Blacklist tst_QGuiEventLoop::processEvents in macOS 10.12 Task-number: QTBUG-61131 Change-Id: Ia54d0976f73e733199503e3510daf3d6fa4253a7 Reviewed-by: J-P Nurmi --- tests/auto/gui/kernel/qguieventloop/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/gui/kernel/qguieventloop/BLACKLIST (limited to 'tests') diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST new file mode 100644 index 0000000000..d55c67998d --- /dev/null +++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST @@ -0,0 +1,2 @@ +[processEvents] +osx-10.12 -- cgit v1.2.3 From 68bcbe2470f1dec54b7803d847f7aa755b07c058 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 7 Jun 2017 16:20:10 +0200 Subject: Fix tst_QImageReader::imageFormatBeforeRead The test was never loading images from a valid path, and thus never had any fullfill the base option which meant nothing was tested. Making it work revealed that the Format option on BMP formats doesn't predict semi-transparent files. Change-Id: I7035a0f63ebfbce940ce7a17a6142cf177480798 Reviewed-by: Eirik Aavitsland --- tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 19948edcdf..574ad805ca 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -728,13 +728,15 @@ void tst_QImageReader::imageFormatBeforeRead() SKIP_IF_UNSUPPORTED(format); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); + QVERIFY(reader.canRead()); if (reader.supportsOption(QImageIOHandler::ImageFormat)) { QImage::Format fileFormat = reader.imageFormat(); QCOMPARE(fileFormat, imageFormat); QSize size = reader.size(); QImage image(size, fileFormat); QVERIFY(reader.read(&image)); + QEXPECT_FAIL("bmp-3", "Semi-transparent BMPs not predicted", Continue); QCOMPARE(image.format(), fileFormat); } } -- cgit v1.2.3