summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-16 21:02:26 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-16 21:02:26 +0100
commit3f17d0349b2d9c85491a6caaaee82918959ef5ef (patch)
tree78ab938704af14d78b6cf26fbc4de73231ddab3b /tests
parent6839aead0430a9b07b60fa3a1a7d685fe5d2d1ef (diff)
parent9d1bcd727ae50331980e52119f2256266c27b5d4 (diff)
downloadqtbase-3f17d0349b2d9c85491a6caaaee82918959ef5ef.tar.gz
qtbase-3f17d0349b2d9c85491a6caaaee82918959ef5ef.tar.bz2
qtbase-3f17d0349b2d9c85491a6caaaee82918959ef5ef.zip
Merge 5.4 into 5.4.1
Change-Id: I78d848c0bb396584a205a8066d253f2bcac8da56
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qdatastream/qdatastream.pro5
-rw-r--r--tests/auto/corelib/io/qdatastream/testdata.qrc5
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/android_testdata.qrc6
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro6
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp45
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro5
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc8
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp2
-rw-r--r--tests/auto/dbus/qdbusmarshall/common.h4
-rw-r--r--tests/auto/gui/image/qimage/qimage.pro2
-rw-r--r--tests/auto/gui/image/qimage/qimage.qrc22
-rw-r--r--tests/auto/gui/image/qimagereader/android_testdata.qrc6
-rw-r--r--tests/auto/gui/image/qimagereader/qimagereader.pro4
-rw-r--r--tests/auto/gui/image/qimagewriter/qimagewriter.pro2
-rw-r--r--tests/auto/gui/image/qimagewriter/qimagewriter.qrc16
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp30
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.qrc28
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro5
-rw-r--r--tests/auto/gui/painting/qpainter/testdata.qrc186
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp1
-rw-r--r--tests/auto/gui/text/qrawfont/tst_qrawfont.cpp42
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp62
-rw-r--r--tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp18
-rw-r--r--tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp30
-rwxr-xr-xtests/auto/test.pl41
-rw-r--r--tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp6
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro6
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/testdata.qrc11
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp34
-rw-r--r--tests/auto/widgets/kernel/qlayout/qlayout.pro5
-rw-r--r--tests/auto/widgets/kernel/qlayout/testdata.qrc5
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp4
-rw-r--r--tests/auto/widgets/styles/qstyle/qstyle.pro5
-rw-r--r--tests/auto/widgets/styles/qstyle/testdata.qrc20
-rw-r--r--tests/benchmarks/benchmarks.pro2
-rw-r--r--tests/manual/diaglib/eventfilter.cpp74
-rw-r--r--tests/manual/qscreen/main.cpp5
-rw-r--r--tests/manual/qscreen/propertyfield.cpp7
-rw-r--r--tests/manual/qscreen/propertyfield.h1
40 files changed, 685 insertions, 85 deletions
diff --git a/tests/auto/corelib/io/qdatastream/qdatastream.pro b/tests/auto/corelib/io/qdatastream/qdatastream.pro
index 25c29b83ee..9ab2b0948d 100644
--- a/tests/auto/corelib/io/qdatastream/qdatastream.pro
+++ b/tests/auto/corelib/io/qdatastream/qdatastream.pro
@@ -5,3 +5,8 @@ SOURCES = tst_qdatastream.cpp
TESTDATA += datastream.q42
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/corelib/io/qdatastream/testdata.qrc b/tests/auto/corelib/io/qdatastream/testdata.qrc
new file mode 100644
index 0000000000..fb63cb3438
--- /dev/null
+++ b/tests/auto/corelib/io/qdatastream/testdata.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>datastream.q42</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/corelib/io/qtemporaryfile/android_testdata.qrc b/tests/auto/corelib/io/qtemporaryfile/android_testdata.qrc
new file mode 100644
index 0000000000..f30290c262
--- /dev/null
+++ b/tests/auto/corelib/io/qtemporaryfile/android_testdata.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/android_testdata">
+ <file>tst_qtemporaryfile.cpp</file>
+ <file>resources/test.txt</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro
index 8a91340e5f..c16a729ad0 100644
--- a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro
+++ b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro
@@ -5,4 +5,8 @@ QT = core testlib
SOURCES = tst_qtemporaryfile.cpp
TESTDATA += tst_qtemporaryfile.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-RESOURCES += qtemporaryfile.qrc \ No newline at end of file
+RESOURCES += qtemporaryfile.qrc
+
+android:!android-no-sdk {
+ RESOURCES += android_testdata.qrc
+}
diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
index a08a0ae777..29a3c4e18a 100644
--- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -92,6 +92,24 @@ void tst_QTemporaryFile::initTestCase()
// For QTBUG_4796
QVERIFY(QDir("test-XXXXXX").exists() || QDir().mkdir("test-XXXXXX"));
QCoreApplication::setApplicationName("tst_qtemporaryfile");
+
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ QString sourceDir(":/android_testdata/");
+ QDirIterator it(sourceDir, QDirIterator::Subdirectories);
+ while (it.hasNext()) {
+ it.next();
+
+ QFileInfo sourceFileInfo = it.fileInfo();
+ if (!sourceFileInfo.isDir()) {
+ QFileInfo destinationFileInfo(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + sourceFileInfo.filePath().mid(sourceDir.length()));
+
+ if (!destinationFileInfo.exists()) {
+ QVERIFY(QDir().mkpath(destinationFileInfo.path()));
+ QVERIFY(QFile::copy(sourceFileInfo.filePath(), destinationFileInfo.filePath()));
+ }
+ }
+ }
+#endif
}
void tst_QTemporaryFile::cleanupTestCase()
@@ -253,20 +271,21 @@ void tst_QTemporaryFile::autoRemove()
QVERIFY(!QFile::exists(fileName));
}
+struct ChdirOnReturn
+{
+ ChdirOnReturn(const QString& d) : dir(d) {}
+ ~ChdirOnReturn() {
+ QDir::setCurrent(dir);
+ }
+ QString dir;
+};
+
void tst_QTemporaryFile::nonWritableCurrentDir()
{
#ifdef Q_OS_UNIX
if (::geteuid() == 0)
QSKIP("not valid running this test as root");
- struct ChdirOnReturn
- {
- ChdirOnReturn(const QString& d) : dir(d) {}
- ~ChdirOnReturn() {
- QDir::setCurrent(dir);
- }
- QString dir;
- };
ChdirOnReturn cor(QDir::currentPath());
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
@@ -443,6 +462,12 @@ void tst_QTemporaryFile::rename()
void tst_QTemporaryFile::renameFdLeak()
{
#ifdef Q_OS_UNIX
+
+# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ ChdirOnReturn cor(QDir::currentPath());
+ QDir::setCurrent(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
+# endif
+
const QByteArray sourceFile = QFile::encodeName(QFINDTESTDATA(__FILE__));
QVERIFY(!sourceFile.isEmpty());
// Test this on Unix only
@@ -646,7 +671,11 @@ void tst_QTemporaryFile::createNativeFile_data()
QTest::addColumn<bool>("valid");
QTest::addColumn<QByteArray>("content");
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ const QString nativeFilePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/resources/test.txt");
+#else
const QString nativeFilePath = QFINDTESTDATA("resources/test.txt");
+#endif
QTest::newRow("nativeFile") << nativeFilePath << (qint64)-1 << false << QByteArray();
QTest::newRow("nativeFileWithPos") << nativeFilePath << (qint64)5 << false << QByteArray();
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro
index 498d8f9c40..29b9854ebb 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -5,3 +5,8 @@ SOURCES = tst_qtextboundaryfinder.cpp
TESTDATA += data
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc b/tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc
new file mode 100644
index 0000000000..0cc4ccaa57
--- /dev/null
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource prefix="/">
+ <file>data/GraphemeBreakTest.txt</file>
+ <file>data/LineBreakTest.txt</file>
+ <file>data/SentenceBreakTest.txt</file>
+ <file>data/WordBreakTest.txt</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index df6fb9e9bc..70794a52f5 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -294,6 +294,7 @@ void tst_QDBusConnection::connectToPeer()
"", "newconn");
QVERIFY(!con.isConnected());
QVERIFY(con.lastError().isValid());
+ QDBusConnection::disconnectFromPeer("newconn");
}
QDBusServer server;
@@ -303,6 +304,7 @@ void tst_QDBusConnection::connectToPeer()
"unix:abstract=/tmp/dbus-XXXXXXXXXX,guid=00000000000000000000000000000000", "newconn2");
QVERIFY(!con.isConnected());
QVERIFY(con.lastError().isValid());
+ QDBusConnection::disconnectFromPeer("newconn2");
}
{
diff --git a/tests/auto/dbus/qdbusmarshall/common.h b/tests/auto/dbus/qdbusmarshall/common.h
index 76fe0e4bfb..323b54a137 100644
--- a/tests/auto/dbus/qdbusmarshall/common.h
+++ b/tests/auto/dbus/qdbusmarshall/common.h
@@ -30,7 +30,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <math.h> // isnan
+#include <qmath.h> // qIsNan
#include <qvariant.h>
#ifdef Q_OS_UNIX
@@ -320,7 +320,7 @@ bool compare(const QVariant &v1, const QVariant &v2);
bool compare(double d1, double d2)
{
- if (isnan(d1) && isnan(d2))
+ if (qIsNaN(d1) && qIsNaN(d2))
return true;
return d1 == d2;
}
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro
index 117e34653d..42280d3bd4 100644
--- a/tests/auto/gui/image/qimage/qimage.pro
+++ b/tests/auto/gui/image/qimage/qimage.pro
@@ -6,4 +6,6 @@ SOURCES += tst_qimage.cpp
QT += core-private gui-private testlib
contains(QT_CONFIG, c++11): CONFIG += c++11
+android:!android-no-sdk:RESOURCES+=qimage.qrc
+
TESTDATA += images/*
diff --git a/tests/auto/gui/image/qimage/qimage.qrc b/tests/auto/gui/image/qimage/qimage.qrc
new file mode 100644
index 0000000000..e5de27faf8
--- /dev/null
+++ b/tests/auto/gui/image/qimage/qimage.qrc
@@ -0,0 +1,22 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/image.bmp</file>
+ <file>images/image.gif</file>
+ <file>images/image.ico</file>
+ <file>images/image.jpg</file>
+ <file>images/image.pbm</file>
+ <file>images/image.pgm</file>
+ <file>images/image.png</file>
+ <file>images/image.ppm</file>
+ <file>images/image.xbm</file>
+ <file>images/image.xpm</file>
+ <file>images/jpeg_exif_orientation_value_1.jpg</file>
+ <file>images/jpeg_exif_orientation_value_2.jpg</file>
+ <file>images/jpeg_exif_orientation_value_3.jpg</file>
+ <file>images/jpeg_exif_orientation_value_4.jpg</file>
+ <file>images/jpeg_exif_orientation_value_5.jpg</file>
+ <file>images/jpeg_exif_orientation_value_6.jpg</file>
+ <file>images/jpeg_exif_orientation_value_7.jpg</file>
+ <file>images/jpeg_exif_orientation_value_8.jpg</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/image/qimagereader/android_testdata.qrc b/tests/auto/gui/image/qimagereader/android_testdata.qrc
new file mode 100644
index 0000000000..bba32781fa
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/android_testdata.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/trans.gif</file>
+ <file>images/kollada-noext</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/image/qimagereader/qimagereader.pro b/tests/auto/gui/image/qimagereader/qimagereader.pro
index 7686643b3a..76fb4d8bfc 100644
--- a/tests/auto/gui/image/qimagereader/qimagereader.pro
+++ b/tests/auto/gui/image/qimagereader/qimagereader.pro
@@ -5,6 +5,10 @@ MOC_DIR=tmp
QT += core-private gui-private network testlib
RESOURCES += qimagereader.qrc
+android: !android-no-sdk {
+ RESOURCES += android_testdata.qrc
+}
+
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300
diff --git a/tests/auto/gui/image/qimagewriter/qimagewriter.pro b/tests/auto/gui/image/qimagewriter/qimagewriter.pro
index f77ff0659b..ce6707ec92 100644
--- a/tests/auto/gui/image/qimagewriter/qimagewriter.pro
+++ b/tests/auto/gui/image/qimagewriter/qimagewriter.pro
@@ -5,5 +5,5 @@ SOURCES += tst_qimagewriter.cpp
MOC_DIR=tmp
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
-
+android:!android-no-sdk:RESOURCES+= qimagewriter.qrc
TESTDATA += images/*
diff --git a/tests/auto/gui/image/qimagewriter/qimagewriter.qrc b/tests/auto/gui/image/qimagewriter/qimagewriter.qrc
new file mode 100644
index 0000000000..29b036e303
--- /dev/null
+++ b/tests/auto/gui/image/qimagewriter/qimagewriter.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/beavis.jpg</file>
+ <file>images/colorful.bmp</file>
+ <file>images/earth.gif</file>
+ <file>images/font.bmp</file>
+ <file>images/gnus.xbm</file>
+ <file>images/kollada.png</file>
+ <file>images/marble.xpm</file>
+ <file>images/ship63.pbm</file>
+ <file>images/teapot.ppm</file>
+ <file>images/trolltech.gif</file>
+ <file>images/YCbCr_cmyk.jpg</file>
+ <file>images/YCbCr_rgb.jpg</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 7e826310a1..f1045a8cf7 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -90,6 +90,7 @@ private slots:
void saveToTemporaryFile();
private:
QString prefix;
+ QString writePrefix;
};
// helper to skip an autotest when the given image format is not supported
@@ -114,6 +115,11 @@ void tst_QImageWriter::initTestCase()
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ writePrefix = QDir::homePath();
+#else
+ writePrefix = prefix;
+#endif
}
// Testing get/set functions
@@ -212,7 +218,7 @@ void tst_QImageWriter::writeImage()
QVERIFY2(!image.isNull(), qPrintable(reader.errorString()));
}
{
- QImageWriter writer(prefix + "gen-" + fileName, format);
+ QImageWriter writer(writePrefix + "gen-" + fileName, format);
QVERIFY(writer.write(image));
}
@@ -224,11 +230,11 @@ void tst_QImageWriter::writeImage()
#endif
if (!skip) {
// Shouldn't be able to write to read-only file
- QFile sourceFile(prefix + "gen-" + fileName);
+ QFile sourceFile(writePrefix + "gen-" + fileName);
QFile::Permissions permissions = sourceFile.permissions();
QVERIFY(sourceFile.setPermissions(QFile::ReadOwner | QFile::ReadUser | QFile::ReadGroup | QFile::ReadOther));
- QImageWriter writer(prefix + "gen-" + fileName, format);
+ QImageWriter writer(writePrefix + "gen-" + fileName, format);
QVERIFY(!writer.write(image));
QVERIFY(sourceFile.setPermissions(permissions));
@@ -237,7 +243,7 @@ void tst_QImageWriter::writeImage()
QImage image2;
{
- QImageReader reader(prefix + "gen-" + fileName);
+ QImageReader reader(writePrefix + "gen-" + fileName);
image2 = reader.read();
QVERIFY(!image2.isNull());
}
@@ -456,7 +462,7 @@ void tst_QImageWriter::supportsOption()
<< QImageIOHandler::Animation
<< QImageIOHandler::BackgroundColor;
- QImageWriter writer(prefix + fileName);
+ QImageWriter writer(writePrefix + fileName);
for (int i = 0; i < options.size(); ++i) {
QVERIFY(writer.supportsOption(QImageIOHandler::ImageOption(options.at(i))));
allOptions.remove(QImageIOHandler::ImageOption(options.at(i)));
@@ -472,13 +478,13 @@ void tst_QImageWriter::saveWithNoFormat_data()
QTest::addColumn<QByteArray>("format");
QTest::addColumn<QImageWriter::ImageWriterError>("error");
- QTest::newRow("garble") << prefix + QString("gen-out.garble") << QByteArray("jpeg") << QImageWriter::UnsupportedFormatError;
- QTest::newRow("bmp") << prefix + QString("gen-out.bmp") << QByteArray("bmp") << QImageWriter::ImageWriterError(0);
- QTest::newRow("xbm") << prefix + QString("gen-out.xbm") << QByteArray("xbm") << QImageWriter::ImageWriterError(0);
- QTest::newRow("xpm") << prefix + QString("gen-out.xpm") << QByteArray("xpm") << QImageWriter::ImageWriterError(0);
- QTest::newRow("png") << prefix + QString("gen-out.png") << QByteArray("png") << QImageWriter::ImageWriterError(0);
- QTest::newRow("ppm") << prefix + QString("gen-out.ppm") << QByteArray("ppm") << QImageWriter::ImageWriterError(0);
- QTest::newRow("pbm") << prefix + QString("gen-out.pbm") << QByteArray("pbm") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("garble") << writePrefix + QString("gen-out.garble") << QByteArray("jpeg") << QImageWriter::UnsupportedFormatError;
+ QTest::newRow("bmp") << writePrefix + QString("gen-out.bmp") << QByteArray("bmp") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("xbm") << writePrefix + QString("gen-out.xbm") << QByteArray("xbm") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("xpm") << writePrefix + QString("gen-out.xpm") << QByteArray("xpm") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("png") << writePrefix + QString("gen-out.png") << QByteArray("png") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("ppm") << writePrefix + QString("gen-out.ppm") << QByteArray("ppm") << QImageWriter::ImageWriterError(0);
+ QTest::newRow("pbm") << writePrefix + QString("gen-out.pbm") << QByteArray("pbm") << QImageWriter::ImageWriterError(0);
}
void tst_QImageWriter::saveWithNoFormat()
diff --git a/tests/auto/gui/image/qpixmap/qpixmap.qrc b/tests/auto/gui/image/qpixmap/qpixmap.qrc
index 99fde61a29..3965622dba 100644
--- a/tests/auto/gui/image/qpixmap/qpixmap.qrc
+++ b/tests/auto/gui/image/qpixmap/qpixmap.qrc
@@ -1,5 +1,27 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
+<RCC>
+ <qresource>
+ <file>loadFromData/designer_argb32.png</file>
+ <file>loadFromData/designer_indexed8_no_alpha_animated.gif</file>
+ <file>loadFromData/designer_indexed8_no_alpha.gif</file>
+ <file>loadFromData/designer_indexed8_no_alpha.png</file>
+ <file>loadFromData/designer_indexed8_with_alpha_animated.gif</file>
+ <file>loadFromData/designer_indexed8_with_alpha.gif</file>
+ <file>loadFromData/designer_indexed8_with_alpha.png</file>
+ <file>loadFromData/designer_rgb32.jpg</file>
+ <file>loadFromData/designer_rgb32.png</file>
+ <file>convertFromImage/task31722_1/img1.png</file>
+ <file>convertFromImage/task31722_1/img2.png</file>
+ <file>convertFromToHICON/icon_8bpp_16x16.png</file>
+ <file>convertFromToHICON/icon_8bpp_32x32.png</file>
+ <file>convertFromToHICON/icon_8bpp_48x48.png</file>
+ <file>convertFromToHICON/icon_8bpp.ico</file>
+ <file>convertFromToHICON/icon_32bpp_16x16.png</file>
+ <file>convertFromToHICON/icon_32bpp_32x32.png</file>
+ <file>convertFromToHICON/icon_32bpp_48x48.png</file>
+ <file>convertFromToHICON/icon_32bpp_256x256.png</file>
+ <file>convertFromToHICON/icon_32bpp.ico</file>
+ <file>convertFromImage/task31722_0/img1.png</file>
+ <file>convertFromImage/task31722_0/img2.png</file>
<file>images/designer.png</file>
<file>images/dx_0_dy_0_50_50_100_100.png</file>
<file>images/dx_0_dy_0_null.png</file>
@@ -25,5 +47,5 @@
<file>images/dx_-128_dy_-128_x_y_w_h.png</file>
<file>images/dx_128_dy_128_x_y_w_h.png</file>
<file>images/dx_1_dy_0_null.png</file>
-</qresource>
+ </qresource>
</RCC>
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 752f9be1f4..7e9d438e1b 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -10,3 +10,8 @@ SOURCES += tst_qpainter.cpp
TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \
task217400.png
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/gui/painting/qpainter/testdata.qrc b/tests/auto/gui/painting/qpainter/testdata.qrc
new file mode 100644
index 0000000000..a7b8c222e5
--- /dev/null
+++ b/tests/auto/gui/painting/qpainter/testdata.qrc
@@ -0,0 +1,186 @@
+<RCC>
+ <qresource prefix="/">
+ <file>task217400.png</file>
+ <file>drawEllipse/10x10SizeAt0x0.png</file>
+ <file>drawEllipse/10x10SizeAt100x100.png</file>
+ <file>drawEllipse/10x10SizeAt200x200.png</file>
+ <file>drawEllipse/13x100SizeAt0x0.png</file>
+ <file>drawEllipse/13x100SizeAt100x100.png</file>
+ <file>drawEllipse/13x100SizeAt200x200.png</file>
+ <file>drawEllipse/200x200SizeAt0x0.png</file>
+ <file>drawEllipse/200x200SizeAt100x100.png</file>
+ <file>drawEllipse/200x200SizeAt200x200.png</file>
+ <file>drawLine_rop_bitmap/dst.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_AndNotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_AndROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_ClearROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_CopyROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NandROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NopROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NorROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotAndROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotCopyROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotOrROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotXorROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_OrNotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_OrROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_SetROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_XorROP.xbm</file>
+ <file>drawPixmap_rop/dst1.png</file>
+ <file>drawPixmap_rop/dst2.png</file>
+ <file>drawPixmap_rop/dst3.png</file>
+ <file>drawPixmap_rop/src1.xbm</file>
+ <file>drawPixmap_rop/src2-mask.xbm</file>
+ <file>drawPixmap_rop/src2.xbm</file>
+ <file>drawPixmap_rop/src3.xbm</file>
+ <file>drawPixmap_rop/res/res_AndNotROP0.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP1.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP2.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP3.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP4.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP5.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP6.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP7.png</file>
+ <file>drawPixmap_rop/res/res_AndROP0.png</file>
+ <file>drawPixmap_rop/res/res_AndROP1.png</file>
+ <file>drawPixmap_rop/res/res_AndROP2.png</file>
+ <file>drawPixmap_rop/res/res_AndROP3.png</file>
+ <file>drawPixmap_rop/res/res_AndROP4.png</file>
+ <file>drawPixmap_rop/res/res_AndROP5.png</file>
+ <file>drawPixmap_rop/res/res_AndROP6.png</file>
+ <file>drawPixmap_rop/res/res_AndROP7.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP0.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP1.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP2.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP3.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP4.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP5.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP6.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP7.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP0.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP1.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP2.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP3.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP4.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP5.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP6.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP7.png</file>
+ <file>drawPixmap_rop/res/res_NandROP0.png</file>
+ <file>drawPixmap_rop/res/res_NandROP1.png</file>
+ <file>drawPixmap_rop/res/res_NandROP2.png</file>
+ <file>drawPixmap_rop/res/res_NandROP3.png</file>
+ <file>drawPixmap_rop/res/res_NandROP4.png</file>
+ <file>drawPixmap_rop/res/res_NandROP5.png</file>
+ <file>drawPixmap_rop/res/res_NandROP6.png</file>
+ <file>drawPixmap_rop/res/res_NandROP7.png</file>
+ <file>drawPixmap_rop/res/res_NopROP0.png</file>
+ <file>drawPixmap_rop/res/res_NopROP1.png</file>
+ <file>drawPixmap_rop/res/res_NopROP2.png</file>
+ <file>drawPixmap_rop/res/res_NopROP3.png</file>
+ <file>drawPixmap_rop/res/res_NopROP4.png</file>
+ <file>drawPixmap_rop/res/res_NopROP5.png</file>
+ <file>drawPixmap_rop/res/res_NopROP6.png</file>
+ <file>drawPixmap_rop/res/res_NopROP7.png</file>
+ <file>drawPixmap_rop/res/res_NorROP0.png</file>
+ <file>drawPixmap_rop/res/res_NorROP1.png</file>
+ <file>drawPixmap_rop/res/res_NorROP2.png</file>
+ <file>drawPixmap_rop/res/res_NorROP3.png</file>
+ <file>drawPixmap_rop/res/res_NorROP4.png</file>
+ <file>drawPixmap_rop/res/res_NorROP5.png</file>
+ <file>drawPixmap_rop/res/res_NorROP6.png</file>
+ <file>drawPixmap_rop/res/res_NorROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP7.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP0.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP1.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP2.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP3.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP4.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP5.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP6.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP7.png</file>
+ <file>drawPixmap_rop/res/res_OrROP0.png</file>
+ <file>drawPixmap_rop/res/res_OrROP1.png</file>
+ <file>drawPixmap_rop/res/res_OrROP2.png</file>
+ <file>drawPixmap_rop/res/res_OrROP3.png</file>
+ <file>drawPixmap_rop/res/res_OrROP4.png</file>
+ <file>drawPixmap_rop/res/res_OrROP5.png</file>
+ <file>drawPixmap_rop/res/res_OrROP6.png</file>
+ <file>drawPixmap_rop/res/res_OrROP7.png</file>
+ <file>drawPixmap_rop/res/res_SetROP0.png</file>
+ <file>drawPixmap_rop/res/res_SetROP1.png</file>
+ <file>drawPixmap_rop/res/res_SetROP2.png</file>
+ <file>drawPixmap_rop/res/res_SetROP3.png</file>
+ <file>drawPixmap_rop/res/res_SetROP4.png</file>
+ <file>drawPixmap_rop/res/res_SetROP5.png</file>
+ <file>drawPixmap_rop/res/res_SetROP6.png</file>
+ <file>drawPixmap_rop/res/res_SetROP7.png</file>
+ <file>drawPixmap_rop/res/res_XorROP0.png</file>
+ <file>drawPixmap_rop/res/res_XorROP1.png</file>
+ <file>drawPixmap_rop/res/res_XorROP2.png</file>
+ <file>drawPixmap_rop/res/res_XorROP3.png</file>
+ <file>drawPixmap_rop/res/res_XorROP4.png</file>
+ <file>drawPixmap_rop/res/res_XorROP5.png</file>
+ <file>drawPixmap_rop/res/res_XorROP6.png</file>
+ <file>drawPixmap_rop/res/res_XorROP7.png</file>
+ <file>drawPixmap_rop_bitmap/dst.xbm</file>
+ <file>drawPixmap_rop_bitmap/src1-mask.xbm</file>
+ <file>drawPixmap_rop_bitmap/src1.xbm</file>
+ <file>drawPixmap_rop_bitmap/src2.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_AndNotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_AndROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_ClearROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_CopyROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NandROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NopROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NorROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotAndROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotCopyROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotOrROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotXorROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_OrNotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_OrROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_SetROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_XorROP.xbm</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 41ceebb646..8a0705630d 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -730,6 +730,7 @@ void tst_QPainter::initFrom()
pal.setColor(QPalette::Foreground, QColor(255, 0, 0));
pal.setBrush(QPalette::Background, QColor(0, 255, 0));
widget->setPalette(pal);
+ widget->show();
QFont font = widget->font();
font.setPointSize(26);
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index bd4da12ea3..969c8f9ce7 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -307,24 +307,22 @@ void tst_QRawFont::advances()
bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions();
QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices);
- // On Windows and QNX, freetype engine returns advance of 9 for some of the glyphs
- // when full hinting is used (default on Windows).
- bool mayFail = false;
-#if defined (Q_OS_WIN)
- mayFail = font_d->fontEngine->type() == QFontEngine::Freetype
- && (hintingPreference == QFont::PreferFullHinting
- || hintingPreference == QFont::PreferDefaultHinting);
-#elif defined(Q_OS_QNX)
- mayFail = font_d->fontEngine->type() == QFontEngine::Freetype
- && hintingPreference == QFont::PreferFullHinting;
-#endif
+ bool mayDiffer = font_d->fontEngine->type() == QFontEngine::Freetype
+ && (hintingPreference == QFont::PreferFullHinting
+ || hintingPreference == QFont::PreferDefaultHinting);
for (int i = 0; i < glyphIndices.size(); ++i) {
- if (mayFail && (i == 0 || i == 5)) {
- QEXPECT_FAIL("", "FreeType engine reports unexpected advance "
- "for some glyphs (9 instead of 8)", Continue);
+ if ((i == 0 || i == 5) && mayDiffer) {
+ QVERIFY2(qRound(advances.at(i).x()) == 8
+ || qRound(advances.at(i).x()) == 9,
+ qPrintable(QStringLiteral("%1 != %2 && %1 != %3")
+ .arg(qRound(advances.at(i).x()))
+ .arg(8)
+ .arg(9)));
+ } else {
+ QCOMPARE(qRound(advances.at(i).x()), 8);
}
- QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0));
+
if (supportsSubPixelPositions)
QVERIFY(advances.at(i).x() > 8.0);
@@ -342,11 +340,17 @@ void tst_QRawFont::advances()
QVERIFY(font.advancesForGlyphIndexes(glyphIndices.constData(), advances.data(), numGlyphs));
for (int i = 0; i < glyphIndices.size(); ++i) {
- if (mayFail && (i == 0 || i == 5)) {
- QEXPECT_FAIL("", "FreeType engine reports unexpected advance "
- "for some glyphs (9 instead of 8)", Continue);
+ if ((i == 0 || i == 5) && mayDiffer) {
+ QVERIFY2(qRound(advances.at(i).x()) == 8
+ || qRound(advances.at(i).x()) == 9,
+ qPrintable(QStringLiteral("%1 != %2 && %1 != %3")
+ .arg(qRound(advances.at(i).x()))
+ .arg(8)
+ .arg(9)));
+ } else {
+ QCOMPARE(qRound(advances.at(i).x()), 8);
}
- QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0));
+
if (supportsSubPixelPositions)
QVERIFY(advances.at(i).x() > 8.0);
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index 4b2970cd17..4fa8575153 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -1280,6 +1280,13 @@ void tst_QTextLayout::smallTextLengthWrapAtWordBoundaryOrAnywhere()
void tst_QTextLayout::testDefaultTabs()
{
QTextLayout layout("Foo\tBar\ta slightly longer text\tend.", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -1322,6 +1329,13 @@ void tst_QTextLayout::testDefaultTabs()
void tst_QTextLayout::testTabs()
{
QTextLayout layout("Foo\tBar.", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
QTextOption option = layout.textOption();
option.setTabStop(150);
@@ -1339,6 +1353,13 @@ void tst_QTextLayout::testTabs()
void tst_QTextLayout::testMultilineTab()
{
QTextLayout layout("Lorem ipsum dolor sit\tBar.", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
// test if this works on the second line.
layout.beginLayout();
@@ -1348,12 +1369,20 @@ void tst_QTextLayout::testMultilineTab()
line.setLineWidth(220.);
layout.endLayout();
+
QCOMPARE(line.cursorToX(22), 80.);
}
void tst_QTextLayout::testMultiTab()
{
QTextLayout layout("Foo\t\t\tBar.", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -1367,6 +1396,13 @@ void tst_QTextLayout::testTabsInAlignedParag()
{
QTextLayout layout("Foo\tsome more words", testFont);
layout.setCacheEnabled(true);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
QTextOption option = layout.textOption();
// right
option.setAlignment(Qt::AlignRight);
@@ -1426,6 +1462,12 @@ void tst_QTextLayout::testRightTab()
*/
layout.setCacheEnabled(true);
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
QTextOption option = layout.textOption();
QList<QTextOption::Tab> tabs;
QTextOption::Tab tab;
@@ -1463,6 +1505,13 @@ void tst_QTextLayout::testRightTab()
void tst_QTextLayout::testCenteredTab()
{
QTextLayout layout("Foo\tBar", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
// test if centering the tab works. We expect the center of 'Bar.' to be at the tab point.
QTextOption option = layout.textOption();
@@ -1484,6 +1533,13 @@ void tst_QTextLayout::testCenteredTab()
void tst_QTextLayout::testDelimiterTab()
{
QTextLayout layout("Foo\tBar. Barrabas", testFont);
+
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
layout.setCacheEnabled(true);
// try the different delimiter characters to see if the alignment works there.
QTextOption option = layout.textOption();
@@ -1537,6 +1593,12 @@ void tst_QTextLayout::tabsForRtl()
*/
layout.setCacheEnabled(true);
+ QFont font = layout.font();
+ QFontPrivate *fd = QFontPrivate::get(font);
+ qreal dpiScale = qreal(fd->dpi) / qreal(qt_defaultDpiY());
+ if (!qFuzzyCompare(dpiScale, 1.0))
+ QSKIP("Test logic does not work when tabs are scaled by dpi");
+
QTextOption option = layout.textOption();
QList<QTextOption::Tab> tabs;
QTextOption::Tab tab;
diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
index cc8dd2105f..e7f30f8940 100644
--- a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
+++ b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
@@ -200,6 +200,12 @@ void tst_QDnsLookup::lookup()
lookup.lookup();
QVERIFY(waitForDone(&lookup));
QVERIFY(lookup.isFinished());
+
+#if defined(Q_OS_ANDROID)
+ if (lookup.errorString() == QStringLiteral("Not yet supported on Android"))
+ QEXPECT_FAIL("", "Not yet supported on Android", Abort);
+#endif
+
QVERIFY2(int(lookup.error()) == error, qPrintable(lookup.errorString()));
if (error == QDnsLookup::NoError)
QVERIFY(lookup.errorString().isEmpty());
@@ -295,6 +301,12 @@ void tst_QDnsLookup::lookupReuse()
lookup.lookup();
QVERIFY(waitForDone(&lookup));
QVERIFY(lookup.isFinished());
+
+#if defined(Q_OS_ANDROID)
+ if (lookup.errorString() == QStringLiteral("Not yet supported on Android"))
+ QEXPECT_FAIL("", "Not yet supported on Android", Abort);
+#endif
+
QCOMPARE(int(lookup.error()), int(QDnsLookup::NoError));
QVERIFY(!lookup.hostAddressRecords().isEmpty());
QCOMPARE(lookup.hostAddressRecords().first().name(), domainName("a-single"));
@@ -333,6 +345,12 @@ void tst_QDnsLookup::lookupAbortRetry()
lookup.lookup();
QVERIFY(waitForDone(&lookup));
QVERIFY(lookup.isFinished());
+
+#if defined(Q_OS_ANDROID)
+ if (lookup.errorString() == QStringLiteral("Not yet supported on Android"))
+ QEXPECT_FAIL("", "Not yet supported on Android", Abort);
+#endif
+
QCOMPARE(int(lookup.error()), int(QDnsLookup::NoError));
QVERIFY(!lookup.hostAddressRecords().isEmpty());
QCOMPARE(lookup.hostAddressRecords().first().name(), domainName("aaaa-single"));
diff --git a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
index 8321f4fee1..a44afcbe8f 100644
--- a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
+++ b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
@@ -45,6 +45,10 @@ private slots:
void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop()
{
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ QSKIP("Not supported on Android");
+#endif
+
// based on testcase provided in QTBUG-39488
QByteArray msg = "Hello World";
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index a862ce2094..ecf3a9b050 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -147,6 +147,8 @@ private slots:
void invalidQuery();
void batchExec_data() { generic_data(); }
void batchExec();
+ void QTBUG_43874_data() { generic_data(); }
+ void QTBUG_43874();
void oraArrayBind_data() { generic_data(); }
void oraArrayBind();
void lastInsertId_data() { generic_data(); }
@@ -338,6 +340,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
<< qTableName("blobstest", __FILE__, db)
<< qTableName("oraRowId", __FILE__, db)
<< qTableName("qtest_batch", __FILE__, db)
+ << qTableName("bug43874", __FILE__, db)
<< qTableName("bug6421", __FILE__, db).toUpper()
<< qTableName("bug5765", __FILE__, db)
<< qTableName("bug6852", __FILE__, db)
@@ -2185,6 +2188,33 @@ void tst_QSqlQuery::batchExec()
QVERIFY( q.value( 3 ).isNull() );
}
+void tst_QSqlQuery::QTBUG_43874()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlQuery q(db);
+ const QString tableName = qTableName("bug43874", __FILE__, db);
+
+ QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id INT)"));
+ QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (id) VALUES (?)"));
+
+ for (int i = 0; i < 2; ++i) {
+ QVariantList ids;
+ ids << i;
+ q.addBindValue(ids);
+ QVERIFY_SQL(q, execBatch());
+ }
+ QVERIFY_SQL(q, exec("SELECT id FROM " + tableName + " ORDER BY id"));
+
+ QVERIFY(q.next());
+ QCOMPARE(q.value(0).toInt(), 0);
+
+ QVERIFY(q.next());
+ QCOMPARE(q.value(0).toInt(), 1);
+}
+
void tst_QSqlQuery::oraArrayBind()
{
QFETCH( QString, dbName );
diff --git a/tests/auto/test.pl b/tests/auto/test.pl
index 7c3708472c..48166e1c30 100755
--- a/tests/auto/test.pl
+++ b/tests/auto/test.pl
@@ -138,35 +138,22 @@ sub handleDir {
my ($dir) = @_;
my $currentDir = getcwd();
- chdir($dir) || die("Could not chdir to $dir");
- my @components;
- my $command;
- @components = split(/\//, $dir);
- my $component = $components[$#components];
-
- $command = "tst_".$component;
-
- if ( -e $command.$EXE_SUFFIX )
- {
- executeTestCurrentDir($command);
- } else {
- opendir(DIR, $dir);
- my @files = readdir(DIR);
- closedir DIR;
- my $file;
- foreach $file (@files)
- {
- #skip hidden files
- next if (substr($file,0,1) eq ".");
-
- if ( -d $dir."/".$file)
- {
- handleDir($dir."/".$file)
- }
-
+ opendir(DIR, $dir);
+ my @files = readdir(DIR);
+ closedir DIR;
+ my $file;
+ foreach $file (@files) {
+ #skip hidden files
+ next if (substr($file,0,1) eq ".");
+
+ if ( -d $dir."/".$file) {
+ handleDir($dir."/".$file)
+ } elsif ( $file =~ /^tst_/ and -x $dir."/".$file ) {
+ chdir($dir) || die("Could not chdir to $dir");
+ executeTestCurrentDir($file);
+ chdir($currentDir);
}
}
- chdir($currentDir);
}
sub executeTestCurrentDir {
diff --git a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
index 3ed8e1e88e..273be1d9c3 100644
--- a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
+++ b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
@@ -113,6 +113,12 @@ void tst_QSidebar::addUrls()
QAbstractItemModel *model = qsidebar.model();
QDir testDir = QDir::home();
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ // temp and home is the same directory on Android
+ testDir.mkdir(QStringLiteral("test"));
+ QVERIFY(testDir.cd(QStringLiteral("test")));
+#endif
+
// default
QCOMPARE(model->rowCount(), 0);
diff --git a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
index 680286d1e4..79848ac22c 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
+++ b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
@@ -13,9 +13,13 @@ wince* {
DEPLOYMENT += addit tests sourceFile
}
-wince*: {
+android|wince*: {
DEFINES += SRCDIR=\\\"./\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/widgets/itemviews/qdirmodel/testdata.qrc b/tests/auto/widgets/itemviews/qdirmodel/testdata.qrc
new file mode 100644
index 0000000000..e0ef4203fe
--- /dev/null
+++ b/tests/auto/widgets/itemviews/qdirmodel/testdata.qrc
@@ -0,0 +1,11 @@
+<RCC>
+ <qresource prefix="/android_testdata">
+ <file>dirtest/test1/dummy</file>
+ <file>dirtest/test1/test</file>
+ <file>test/file01.tst</file>
+ <file>test/file02.tst</file>
+ <file>test/file03.tst</file>
+ <file>test/file04.tst</file>
+ <file>tst_qdirmodel.cpp</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
index 4fee5fb1e5..56a8d1f1f4 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
@@ -42,6 +42,7 @@ class tst_QDirModel : public QObject
{
Q_OBJECT
public slots:
+ void initTestCase();
void cleanupTestCase();
void init();
private slots:
@@ -113,6 +114,29 @@ void tst_QDirModel::getSetCheck()
QCOMPARE(true, obj1.lazyChildCount());
}
+void tst_QDirModel::initTestCase()
+{
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ QString dataPath = SRCDIR;
+ QString resourceSourcePath = QStringLiteral(":/android_testdata");
+ QDirIterator it(resourceSourcePath, QDirIterator::Subdirectories);
+ while (it.hasNext()) {
+ it.next();
+
+ QFileInfo fileInfo = it.fileInfo();
+ if (!fileInfo.isDir()) {
+ QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourceSourcePath.length());
+ QFileInfo destinationFileInfo(destination);
+ if (!destinationFileInfo.exists()) {
+ QDir().mkpath(destinationFileInfo.path());
+ if (!QFile::copy(fileInfo.filePath(), destination))
+ qWarning("Failed to copy %s", qPrintable(fileInfo.filePath()));
+ }
+ }
+ }
+#endif
+}
+
void tst_QDirModel::cleanupTestCase()
{
QDir current;
@@ -556,10 +580,12 @@ void tst_QDirModel::filePath()
model.setResolveSymlinks(false);
QModelIndex index = model.index(SRCDIR "test.lnk");
QVERIFY(index.isValid());
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_ANDROID)
QString path = SRCDIR;
#else
- QString path = QFileInfo(SRCDIR).absoluteFilePath() + "/";
+ QString path = QFileInfo(SRCDIR).absoluteFilePath();
+ if (!path.endsWith("/"))
+ path += "/";
#endif
QCOMPARE(model.filePath(index), path + QString( "test.lnk"));
model.setResolveSymlinks(true);
@@ -592,6 +618,10 @@ void tst_QDirModel::task196768_sorting()
view.setSortingEnabled(true);
index2 = model.index(path);
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ QEXPECT_FAIL("", "QTBUG-43818", Continue);
+#endif
+
QCOMPARE(index.data(), index2.data());
}
diff --git a/tests/auto/widgets/kernel/qlayout/qlayout.pro b/tests/auto/widgets/kernel/qlayout/qlayout.pro
index 4a5db512c8..8bdbde9282 100644
--- a/tests/auto/widgets/kernel/qlayout/qlayout.pro
+++ b/tests/auto/widgets/kernel/qlayout/qlayout.pro
@@ -11,3 +11,8 @@ wince* {
} else {
TESTDATA += baseline/*
}
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/widgets/kernel/qlayout/testdata.qrc b/tests/auto/widgets/kernel/qlayout/testdata.qrc
new file mode 100644
index 0000000000..24e8e56263
--- /dev/null
+++ b/tests/auto/widgets/kernel/qlayout/testdata.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>baseline/smartmaxsize</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index c889643524..0bdc71e55b 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -345,6 +345,10 @@ void tst_QLayout::adjustSizeShouldMakeSureLayoutIsActivated()
void tst_QLayout::testRetainSizeWhenHidden()
{
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ QSKIP("Test does not work on platforms which default to showMaximized()");
+#endif
+
QWidget widget;
QBoxLayout layout(QBoxLayout::TopToBottom, &widget);
diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro
index 4d18971cc6..b4546aa760 100644
--- a/tests/auto/widgets/styles/qstyle/qstyle.pro
+++ b/tests/auto/widgets/styles/qstyle/qstyle.pro
@@ -10,3 +10,8 @@ wince* {
addPixmap.path = .
DEPLOYMENT += addPixmap
}
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc
new file mode 100644
index 0000000000..c16b9be775
--- /dev/null
+++ b/tests/auto/widgets/styles/qstyle/testdata.qrc
@@ -0,0 +1,20 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/mac/button.png</file>
+ <file>images/mac/combobox.png</file>
+ <file>images/mac/lineedit.png</file>
+ <file>images/mac/mdi.png</file>
+ <file>images/mac/menu.png</file>
+ <file>images/mac/radiobutton.png</file>
+ <file>images/mac/slider.png</file>
+ <file>images/mac/spinbox.png</file>
+ <file>images/vista/button.png</file>
+ <file>images/vista/combobox.png</file>
+ <file>images/vista/lineedit.png</file>
+ <file>images/vista/menu.png</file>
+ <file>images/vista/radiobutton.png</file>
+ <file>images/vista/slider.png</file>
+ <file>images/vista/spinbox.png</file>
+ <file>task_25863.png</file>
+ </qresource>
+</RCC>
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index e5a6f5d7d2..8ee8d017ab 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -1,12 +1,12 @@
TEMPLATE = subdirs
SUBDIRS = \
corelib \
- gui \
sql \
# removed-by-refactor qtHaveModule(opengl): SUBDIRS += opengl
qtHaveModule(dbus): SUBDIRS += dbus
qtHaveModule(network): SUBDIRS += network
+qtHaveModule(gui): SUBDIRS += gui
check-trusted.CONFIG += recursive
QMAKE_EXTRA_TARGETS += check-trusted
diff --git a/tests/manual/diaglib/eventfilter.cpp b/tests/manual/diaglib/eventfilter.cpp
index 23a6d44fef..0a815fd883 100644
--- a/tests/manual/diaglib/eventfilter.cpp
+++ b/tests/manual/diaglib/eventfilter.cpp
@@ -36,6 +36,28 @@
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
+#if QT_VERSION >= 0x050000
+# if defined(QT_WIDGETS_LIB)
+# define HAVE_APPLICATION
+# endif
+# if defined(QT_GUI_LIB)
+# define HAVE_GUI_APPLICATION
+# endif
+#else // Qt 5
+# if defined(QT_GUI_LIB)
+# define HAVE_APPLICATION
+# endif
+#endif
+
+#ifdef HAVE_APPLICATION
+# include <QApplication>
+# include <QWidget>
+#endif
+#ifdef HAVE_GUI_APPLICATION
+# include <QtGui/QGuiApplication>
+# include <QtGui/QWindow>
+#endif
+
namespace QtDiag {
EventFilter::EventFilter(EventCategories eventCategories, QObject *p)
@@ -131,16 +153,60 @@ static inline bool matchesType(const QObject *o, EventFilter::ObjectTypes types)
return types & EventFilter::OtherType;
}
+static void formatObject(const QObject *o, QDebug debug)
+{
+ if (o) {
+ debug << o->metaObject()->className();
+ const QString on = o->objectName();
+ if (!on.isEmpty())
+ debug << '/' << on;
+ } else {
+ debug << "null";
+ }
+}
+
+static void formatApplicationState(QDebug debug)
+{
+#if defined(HAVE_APPLICATION)
+ if (const QWidget *mw = QApplication::activeModalWidget()) {
+ debug << "\n QApplication::activeModalWidget = ";
+ formatObject(mw, debug);
+ }
+ if (const QWidget *pw = QApplication::activePopupWidget()) {
+ debug << "\n QApplication::activePopupWidget = ";
+ formatObject(pw, debug);
+ }
+ debug << "\n QApplication::activeWindow = ";
+ formatObject(QApplication::activeWindow(), debug);
+#endif // HAVE_APPLICATION
+#if defined(HAVE_GUI_APPLICATION)
+ if (const QWindow *mw = QGuiApplication::modalWindow()) {
+ debug << "\n QGuiApplication::modalWindow = ";
+ formatObject(mw, debug);
+ }
+ debug << "\n QGuiApplication::focusWindow = ";
+ formatObject(QGuiApplication::focusWindow(), debug);
+#endif // HAVE_GUI_APPLICATION
+}
+
bool EventFilter::eventFilter(QObject *o, QEvent *e)
{
static int n = 0;
if (matchesType(o, m_objectTypes) && m_eventTypes.contains(e->type())) {
QDebug debug = qDebug().nospace();
- const QString on = o->objectName();
- debug << '#' << n++ << ' ' << o->metaObject()->className();
- if (!on.isEmpty())
- debug << '/' << on;
+ debug << '#' << n++ << ' ';
+ formatObject(o, debug);
debug << ' ' << e;
+ switch (e->type()) {
+#if QT_VERSION >= 0x050000
+ case QEvent::FocusAboutToChange:
+#endif
+ case QEvent::FocusIn:
+ formatApplicationState(debug);
+ break;
+ default:
+ break;
+ }
}
return false;
}
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 487e95266b..dc1e0e08c0 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -80,8 +80,11 @@ void screenAdded(QScreen* screen)
// But this works as long as the screens are all virtual siblings
w->show();
QRect geom = w->geometry();
+ geom.setSize(w->sizeHint());
+ if (geom.height() > screen->geometry().height())
+ geom.setHeight(screen->geometry().height() * 9 / 10);
geom.moveCenter(screen->geometry().center());
- w->move(geom.topLeft());
+ w->setGeometry(geom);
props->insert(screen, w);
diff --git a/tests/manual/qscreen/propertyfield.cpp b/tests/manual/qscreen/propertyfield.cpp
index e6392465f2..f1e5e22ec9 100644
--- a/tests/manual/qscreen/propertyfield.cpp
+++ b/tests/manual/qscreen/propertyfield.cpp
@@ -34,8 +34,9 @@
#include "propertyfield.h"
#include <QDebug>
-PropertyField::PropertyField(QObject* subject, const QMetaProperty& prop, QWidget *parent) :
- QLineEdit(parent), m_subject(subject), m_lastChangeTime(QTime::currentTime()), m_prop(prop)
+PropertyField::PropertyField(QObject* subject, const QMetaProperty& prop, QWidget *parent)
+ : QLineEdit(parent), m_subject(subject), m_lastChangeTime(QTime::currentTime()), m_prop(prop)
+ , m_defaultBrush(palette().brush(QPalette::Active, QPalette::Text))
{
setReadOnly(true);
if (prop.hasNotifySignal()) {
@@ -99,7 +100,7 @@ void PropertyField::propertyChanged()
setText(text);
m_lastText = text;
m_lastTextShowing = text;
- modPalette.setBrush(QPalette::Text, Qt::black);
+ modPalette.setBrush(QPalette::Text, m_defaultBrush);
}
setPalette(modPalette);
}
diff --git a/tests/manual/qscreen/propertyfield.h b/tests/manual/qscreen/propertyfield.h
index 2738a215a6..f76ac7fc6b 100644
--- a/tests/manual/qscreen/propertyfield.h
+++ b/tests/manual/qscreen/propertyfield.h
@@ -63,6 +63,7 @@ private:
QString m_lastTextShowing;
QTime m_lastChangeTime;
const QMetaProperty m_prop;
+ QBrush m_defaultBrush;
};
#endif // PROPERTYFIELD_H