summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-06-19 13:25:11 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-19 16:12:34 +0200
commitce09ef431373f45d14ce0a6e7de24aee3666093d (patch)
tree7c998b21f02db55e233e7eeb1599663f1c6b51ca /tests/auto
parent7ad55ca65f42351e231f31f7a9253ae6eaf1ebb3 (diff)
parent97eec16e4ff6367c233f8ea6c4a343c286c3a514 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp7
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp42
-rw-r--r--tests/auto/corelib/io/qresourceengine/qresourceengine.pro4
-rw-r--r--tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST1
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp2
-rw-r--r--tests/auto/corelib/tools/qcollator/tst_qcollator.cpp84
-rw-r--r--tests/auto/corelib/tools/qtimeline/BLACKLIST3
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp16
-rw-r--r--tests/auto/gui/image/qicon/qicon.pro2
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp2
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp6
-rw-r--r--tests/auto/gui/kernel/qguieventloop/BLACKLIST2
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp7
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST3
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp7
-rw-r--r--tests/auto/tools/moc/parse-defines.h9
-rw-r--r--tests/auto/tools/uic/baseline/qpagesetupwidget.ui181
-rw-r--r--tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h139
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp3
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp119
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp2
23 files changed, 435 insertions, 210 deletions
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());
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 6b1516600f..de6eb28503 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();
@@ -1734,6 +1735,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());
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}
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
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
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 <qlocale.h>
#include <qcollator.h>
+#include <private/qglobal_p.h>
#include <cstring>
@@ -88,6 +89,8 @@ void tst_QCollator::compare_data()
QTest::addColumn<int>("result");
QTest::addColumn<int>("caseInsensitiveResult");
QTest::addColumn<bool>("numericMode");
+ QTest::addColumn<bool>("ignorePunctuation");
+ QTest::addColumn<int>("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
}
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
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index 2cebe1fb6f..714eb8a22a 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");
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 571a3c6984..bf8f7ade9e 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")
{
}
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 18649b3de5..574ad805ca 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);
}
@@ -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);
}
}
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
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/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
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();
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
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 @@
<x>0</x>
<y>0</y>
<width>416</width>
- <height>488</height>
+ <height>515</height>
</rect>
</property>
<property name="windowTitle" >
@@ -16,44 +16,24 @@
<property name="margin" >
<number>0</number>
</property>
- <item row="0" column="0" colspan="2" >
- <layout class="QHBoxLayout" name="horizontalLayout_4" >
- <item>
- <widget class="QComboBox" name="unit" />
- </item>
- <item>
- <spacer name="horizontalSpacer_3" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="2" >
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
+ <item row="1" column="0" colspan="2">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
<string>Paper</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2" >
- <item row="0" column="0" >
- <widget class="QLabel" name="pageSizeLabel" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="pageSizeLabel">
+ <property name="text">
<string>Page size:</string>
</property>
- <property name="buddy" >
- <cstring>paperSize</cstring>
+ <property name="buddy">
+ <cstring>pageSizeCombo</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
- <widget class="QComboBox" name="paperSize" />
+ <widget class="QComboBox" name="pageSizeCombo" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="widthLabel" >
@@ -61,14 +41,14 @@
<string>Width:</string>
</property>
<property name="buddy" >
- <cstring>paperWidth</cstring>
+ <cstring>pageWidth</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
- <widget class="QDoubleSpinBox" name="paperWidth" >
+ <widget class="QDoubleSpinBox" name="pageWidth" >
<property name="maximum" >
<double>9999.989999999999782</double>
</property>
@@ -80,12 +60,12 @@
<string>Height:</string>
</property>
<property name="buddy" >
- <cstring>paperHeight</cstring>
+ <cstring>pageHeight</cstring>
</property>
</widget>
</item>
<item>
- <widget class="QDoubleSpinBox" name="paperHeight" >
+ <widget class="QDoubleSpinBox" name="pageHeight" >
<property name="maximum" >
<double>9999.989999999999782</double>
</property>
@@ -122,9 +102,32 @@
</layout>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QGroupBox" name="groupBox_3" >
- <property name="title" >
+ <item row="0" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QComboBox" name="unitCombo"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="1" rowspan="2">
+ <widget class="QWidget" name="preview" native="true"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
<string>Orientation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
@@ -175,12 +178,9 @@
</layout>
</widget>
</item>
- <item rowspan="2" row="2" column="1" >
- <widget class="QWidget" native="1" name="preview" />
- </item>
- <item row="3" column="0" >
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <item row="3" column="0">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
<string>Margins</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
@@ -280,9 +280,25 @@
</item>
</layout>
</item>
- <item row="2" column="1" >
- <widget class="QDoubleSpinBox" name="bottomMargin" >
- <property name="toolTip" >
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDoubleSpinBox" name="bottomMargin">
+ <property name="toolTip">
<string>bottom margin</string>
</property>
<property name="accessibleName" >
@@ -296,28 +312,15 @@
</property>
</widget>
</item>
- <item row="0" column="2" >
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
+ <item row="0" column="0">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0" >
- <spacer name="horizontalSpacer_5" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
+ <property name="sizeHint" stdset="0">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0" >
@@ -333,15 +336,57 @@
</layout>
</widget>
</item>
- <item row="4" column="0" >
- <spacer name="verticalSpacer" >
- <property name="orientation" >
+ <item row="5" column="0" colspan="2">
+ <widget class="QGroupBox" name="pagesPerSheetButtonGroup">
+ <property name="title">
+ <string>Page Layout</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="1">
+ <widget class="QComboBox" name="pagesPerSheetCombo"/>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Page order:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="pagesPerSheetLayoutCombo"/>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Pages per sheet:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
- <height>0</height>
+ <height>40</height>
</size>
</property>
</spacer>
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
};
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 1f4d2e262d..d9bb3b28d7 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -3197,9 +3197,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);
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<QWidget*> 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<QWidget *> 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("<b>TESTING TESTING</b>");
- return widgets;
+ addWidget(spinbox);
+ addWidget(new QLabel("<b>TESTING TESTING</b>"));
}
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())
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
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index 510576f6df..009a607818 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -237,6 +237,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()