summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp4
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp3
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp3
-rw-r--r--tests/auto/gui/kernel/kernel.pro1
-rw-r--r--tests/auto/gui/kernel/qbackingstore/qbackingstore.pro3
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/test.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp6
-rw-r--r--tests/auto/gui/kernel/qguiapplication/qguiapplication.pro2
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp6
-rw-r--r--tests/auto/gui/kernel/qguitimer/qguitimer.pro4
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp34
-rw-r--r--tests/auto/gui/kernel/qwindow/qwindow.pro1
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp84
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp6
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp6
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp18
-rw-r--r--tests/auto/gui/qopengl/qopengl.pro1
-rw-r--r--tests/auto/gui/text/qfontdatabase/qfontdatabase.pro2
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp5
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp2
-rw-r--r--tests/auto/gui/text/qrawfont/qrawfont.pro2
-rw-r--r--tests/auto/gui/text/qrawfont/tst_qrawfont.cpp11
-rw-r--r--tests/auto/gui/text/qstatictext/qstatictext.pro2
-rw-r--r--tests/auto/gui/text/qtextlayout/qtextlayout.pro2
-rw-r--r--tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro2
-rw-r--r--tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp6
-rw-r--r--tests/auto/gui/text/text.pro4
27 files changed, 147 insertions, 75 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index c5c2b13b3e..65571f13c2 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -88,9 +88,7 @@ private slots:
void dotsPerMeterZero();
void convertToFormatPreserveDotsPrMeter();
-#ifndef QT_NO_IMAGE_TEXT
void convertToFormatPreserveText();
-#endif
void rotate_data();
void rotate();
@@ -1143,7 +1141,6 @@ void tst_QImage::convertToFormatPreserveDotsPrMeter()
QCOMPARE(img.dotsPerMeterY(), dpmy);
}
-#ifndef QT_NO_IMAGE_TEXT
void tst_QImage::convertToFormatPreserveText()
{
QImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
@@ -1168,7 +1165,6 @@ void tst_QImage::convertToFormatPreserveText()
QCOMPARE(imgResult2.text(), result);
QCOMPARE(imgResult2.textKeys(), listResult);
}
-#endif // QT_NO_IMAGE_TEXT
void tst_QImage::setColorCount()
{
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 876d69ea1c..12c90445cb 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1487,7 +1487,8 @@ void tst_QImageReader::supportsOption_data()
<< (QIntList() << QImageIOHandler::Gamma
<< QImageIOHandler::Description
<< QImageIOHandler::Quality
- << QImageIOHandler::Size);
+ << QImageIOHandler::Size
+ << QImageIOHandler::ScaledSize);
}
void tst_QImageReader::supportsOption()
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 827fa3606c..f28f84dc60 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -394,7 +394,8 @@ void tst_QImageWriter::supportsOption_data()
<< (QIntList() << QImageIOHandler::Gamma
<< QImageIOHandler::Description
<< QImageIOHandler::Quality
- << QImageIOHandler::Size);
+ << QImageIOHandler::Size
+ << QImageIOHandler::ScaledSize);
}
void tst_QImageWriter::supportsOption()
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index 0bd988b68c..8f191bd42d 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -7,6 +7,7 @@ SUBDIRS=\
qfileopenevent \
qguieventdispatcher \
qguimetatype \
+ qguitimer \
qguivariant \
qinputmethod \
qkeysequence \
diff --git a/tests/auto/gui/kernel/qbackingstore/qbackingstore.pro b/tests/auto/gui/kernel/qbackingstore/qbackingstore.pro
index cc0a2c69f7..211be4c1c0 100644
--- a/tests/auto/gui/kernel/qbackingstore/qbackingstore.pro
+++ b/tests/auto/gui/kernel/qbackingstore/qbackingstore.pro
@@ -4,6 +4,3 @@ TARGET = tst_qbackingstore
QT += core-private gui-private testlib
SOURCES += tst_qbackingstore.cpp
-
-mac: CONFIG += insignificant_test # QTBUG-23059
-win32: CONFIG += insignificant_test # QTBUG-24885
diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro
index 4be6769592..d7a67ae3b6 100644
--- a/tests/auto/gui/kernel/qclipboard/test/test.pro
+++ b/tests/auto/gui/kernel/qclipboard/test/test.pro
@@ -15,8 +15,6 @@ wince* {
DEPLOYMENT += rsc reg_resource
}
-mac: CONFIG += insignificant_test # QTBUG-23057
-
load(testcase) # for target.path and installTestHelperApp()
installTestHelperApp("../copier/copier",copier,copier)
installTestHelperApp("../paster/paster",paster,paster)
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 7f41f0651e..466764f81e 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -158,7 +158,7 @@ void tst_QClipboard::testSignals()
QCOMPARE(selectionChangedSpy.count(), 0);
QCOMPARE(changedSpy.count(), 1);
QCOMPARE(changedSpy.at(0).count(), 1);
- QCOMPARE(qVariantValue<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::Clipboard);
+ QCOMPARE(qvariant_cast<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::Clipboard);
changedSpy.clear();
@@ -168,7 +168,7 @@ void tst_QClipboard::testSignals()
QCOMPARE(selectionChangedSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
QCOMPARE(changedSpy.at(0).count(), 1);
- QCOMPARE(qVariantValue<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::Selection);
+ QCOMPARE(qvariant_cast<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::Selection);
} else {
QCOMPARE(selectionChangedSpy.count(), 0);
}
@@ -183,7 +183,7 @@ void tst_QClipboard::testSignals()
QCOMPARE(searchChangedSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
QCOMPARE(changedSpy.at(0).count(), 1);
- QCOMPARE(qVariantValue<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::FindBuffer);
+ QCOMPARE(qvariant_cast<QClipboard::Mode>(changedSpy.at(0).at(0)), QClipboard::FindBuffer);
} else {
QCOMPARE(searchChangedSpy.count(), 0);
}
diff --git a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
index 777e2c6b1a..fffa097d73 100644
--- a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
+++ b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
@@ -2,5 +2,3 @@ CONFIG += testcase
TARGET = tst_qguiapplication
QT += core gui testlib
SOURCES = tst_qguiapplication.cpp
-
-win32:CONFIG += insignificant_test # QTBUG-24186
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index c0242d95c5..29b65d1fd4 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -116,6 +116,9 @@ void tst_QGuiApplication::focusObject()
QTest::qWaitForWindowShown(&window2);
QTRY_COMPARE(app.focusWindow(), &window2);
QCOMPARE(app.focusObject(), &obj3);
+#ifdef Q_OS_WIN
+ QEXPECT_FAIL("", "QTBUG-24186", Abort);
+#endif
QCOMPARE(spy.count(), 1);
// focus change on unfocused window does not show
@@ -238,6 +241,9 @@ void tst_QGuiApplication::changeFocusWindow()
window2.requestActivateWindow();
QTRY_COMPARE(app.focusWindow(), &window2);
QCOMPARE(window1.windowDuringFocusAboutToChange, &window1);
+#ifdef Q_OS_WIN
+ QEXPECT_FAIL("", "QTBUG-24186", Abort);
+#endif
QCOMPARE(window1.windowDuringFocusOut, &window2);
}
diff --git a/tests/auto/gui/kernel/qguitimer/qguitimer.pro b/tests/auto/gui/kernel/qguitimer/qguitimer.pro
new file mode 100644
index 0000000000..8a71e48007
--- /dev/null
+++ b/tests/auto/gui/kernel/qguitimer/qguitimer.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase
+TARGET = tst_qguitimer
+QT = core gui testlib
+SOURCES += ../../../corelib/kernel/qtimer/tst_qtimer.cpp
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index c4db74b6ec..588584545c 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -197,26 +197,26 @@ void tst_QKeySequence::operatorQString_data()
QTest::addColumn<int>("keycode");
QTest::addColumn<QString>("keystring");
- QTest::newRow( "No modifier" ) << 0 << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "\x0c5" );
+ QTest::newRow( "No modifier" ) << 0 << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString::fromLatin1( "\x0c5" );
#ifndef Q_OS_MAC
QTest::newRow( "Ctrl+Left" ) << int(Qt::CTRL) << int(Qt::Key_Left) << QString( "Ctrl+Left" );
QTest::newRow( "Ctrl+," ) << int(Qt::CTRL) << int(Qt::Key_Comma) << QString( "Ctrl+," );
QTest::newRow( "Alt+Left" ) << int(Qt::ALT) << int(Qt::Key_Left) << QString( "Alt+Left" );
QTest::newRow( "Alt+Shift+Left" ) << int(Qt::ALT | Qt::SHIFT) << int(Qt::Key_Left) << QString( "Alt+Shift+Left" );
- QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Ctrl+\x0c5" );
- QTest::newRow( "Alt" ) << int(Qt::ALT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Alt+\x0c5" );
- QTest::newRow( "Shift" ) << int(Qt::SHIFT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Shift+\x0c5" );
- QTest::newRow( "Meta" ) << int(Qt::META) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString( "Meta+\x0c5" );
+ QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString::fromLatin1( "Ctrl+\x0c5" );
+ QTest::newRow( "Alt" ) << int(Qt::ALT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString::fromLatin1( "Alt+\x0c5" );
+ QTest::newRow( "Shift" ) << int(Qt::SHIFT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString::fromLatin1( "Shift+\x0c5" );
+ QTest::newRow( "Meta" ) << int(Qt::META) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << QString::fromLatin1( "Meta+\x0c5" );
#else
QTest::newRow( "Ctrl+Left" ) << int(Qt::CTRL) << int(Qt::Key_Left) << MacCtrl + macSymbolForQtKey(Qt::Key_Left);
QTest::newRow( "Ctrl+," ) << int(Qt::CTRL) << int(Qt::Key_Comma) << MacCtrl + ",";
QTest::newRow( "Alt+Left" ) << int(Qt::ALT) << int(Qt::Key_Left) << MacAlt + macSymbolForQtKey(Qt::Key_Left);
QTest::newRow( "Alt+Shift+Left" ) << int(Qt::ALT | Qt::SHIFT) << int(Qt::Key_Left) << MacAlt + MacShift + macSymbolForQtKey(Qt::Key_Left);
- QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacCtrl + "\x0c5";
- QTest::newRow( "Alt" ) << int(Qt::ALT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacAlt + "\x0c5";
- QTest::newRow( "Shift" ) << int(Qt::SHIFT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacShift + "\x0c5";
- QTest::newRow( "Meta" ) << int(Qt::META) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacMeta + "\x0c5";
+ QTest::newRow( "Ctrl" ) << int(Qt::CTRL) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacCtrl + QLatin1String("\x0c5");
+ QTest::newRow( "Alt" ) << int(Qt::ALT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacAlt + QLatin1String("\x0c5");
+ QTest::newRow( "Shift" ) << int(Qt::SHIFT) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacShift + QLatin1String("\x0c5");
+ QTest::newRow( "Meta" ) << int(Qt::META) << int(Qt::Key_Aring | Qt::UNICODE_ACCEL) << MacMeta + QLatin1String("\x0c5");
#endif
}
@@ -448,10 +448,10 @@ void tst_QKeySequence::toString_data()
QTest::newRow("Ctrl+Left") << QString("Ctrl+Left") << QString("Ctrl+Left") << QString("Ctrl+Left");
QTest::newRow("Alt+Left") << QString("Alt+Left") << QString("Alt+Left") << QString("Alt+Left");
QTest::newRow("Alt+Shift+Left") << QString("Alt+Shift+Left") << QString("Alt+Shift+Left") << QString("Alt+Shift+Left");
- QTest::newRow("Ctrl") << QString("Ctrl+\x0c5") << QString("Ctrl+\x0c5") << QString("Ctrl+\x0c5");
- QTest::newRow("Alt") << QString("Alt+\x0c5") << QString("Alt+\x0c5") << QString("Alt+\x0c5");
- QTest::newRow("Shift") << QString("Shift+\x0c5") << QString("Shift+\x0c5") << QString("Shift+\x0c5");
- QTest::newRow("Meta") << QString("Meta+\x0c5") << QString("Meta+\x0c5") << QString("Meta+\x0c5");
+ QTest::newRow("Ctrl") << QString::fromLatin1("Ctrl+\x0c5") << QString::fromLatin1("Ctrl+\x0c5") << QString::fromLatin1("Ctrl+\x0c5");
+ QTest::newRow("Alt") << QString::fromLatin1("Alt+\x0c5") << QString::fromLatin1("Alt+\x0c5") << QString::fromLatin1("Alt+\x0c5");
+ QTest::newRow("Shift") << QString::fromLatin1("Shift+\x0c5") << QString::fromLatin1("Shift+\x0c5") << QString::fromLatin1("Shift+\x0c5");
+ QTest::newRow("Meta") << QString::fromLatin1("Meta+\x0c5") << QString::fromLatin1("Meta+\x0c5") << QString::fromLatin1("Meta+\x0c5");
QTest::newRow("Ctrl+Plus") << QString("Ctrl++") << QString("Ctrl++") << QString("Ctrl++");
QTest::newRow("Ctrl+,") << QString("Ctrl+,") << QString("Ctrl+,") << QString("Ctrl+,");
QTest::newRow("Ctrl+,,Ctrl+,") << QString("Ctrl+,,Ctrl+,") << QString("Ctrl+,, Ctrl+,") << QString("Ctrl+,, Ctrl+,");
@@ -467,10 +467,10 @@ void tst_QKeySequence::toString_data()
<< MacAlt + MacShift + macSymbolForQtKey(Qt::Key_Left);
*/
QTest::newRow("Ctrl+Right,Left") << MacCtrl + "Right, Left" << QString("Ctrl+Right, Left") << MacCtrl + macSymbolForQtKey(Qt::Key_Right) + QString(", ") + macSymbolForQtKey(Qt::Key_Left);
- QTest::newRow("Ctrl") << MacCtrl + "\x0c5" << QString("Ctrl+\x0c5") << MacCtrl + "\x0c5";
- QTest::newRow("Alt") << MacAlt + "\x0c5" << QString("Alt+\x0c5") << MacAlt + "\x0c5";
- QTest::newRow("Shift") << MacShift + "\x0c5" << QString("Shift+\x0c5") << MacShift + "\x0c5";
- QTest::newRow("Meta") << MacMeta + "\x0c5" << QString("Meta+\x0c5") << MacMeta + "\x0c5";
+ QTest::newRow("Ctrl") << MacCtrl + QLatin1String("\x0c5") << QString::fromLatin1("Ctrl+\x0c5") << MacCtrl + QLatin1String("\x0c5");
+ QTest::newRow("Alt") << MacAlt + QLatin1String("\x0c5") << QString::fromLatin1("Alt+\x0c5") << MacAlt + QLatin1String("\x0c5");
+ QTest::newRow("Shift") << MacShift + QLatin1String("\x0c5") << QString::fromLatin1("Shift+\x0c5") << MacShift + QLatin1String("\x0c5");
+ QTest::newRow("Meta") << MacMeta + QLatin1String("\x0c5") << QString::fromLatin1("Meta+\x0c5") << MacMeta + QLatin1String("\x0c5");
QTest::newRow("Ctrl+Plus") << MacCtrl + "+" << QString("Ctrl++") << MacCtrl + "+";
QTest::newRow("Ctrl+,") << MacCtrl + "," << QString("Ctrl+,") << MacCtrl + ",";
QTest::newRow("Ctrl+,,Ctrl+,") << MacCtrl + ",, " + MacCtrl + "," << QString("Ctrl+,, Ctrl+,") << MacCtrl + ",, " + MacCtrl + ",";
diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro
index fb8132afab..363f7dd92e 100644
--- a/tests/auto/gui/kernel/qwindow/qwindow.pro
+++ b/tests/auto/gui/kernel/qwindow/qwindow.pro
@@ -6,5 +6,4 @@ QT += core-private gui-private testlib
SOURCES += tst_qwindow.cpp
mac: CONFIG += insignificant_test # QTBUG-23059
-win32: CONFIG += insignificant_test # QTBUG-24904
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 3dc2886b80..ae5bf55b72 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -70,6 +70,7 @@ private slots:
void activateAndClose();
void mouseEventSequence();
void windowModality();
+ void inputReentrancy();
void initTestCase()
{
@@ -141,11 +142,14 @@ private:
void tst_QWindow::eventOrderOnShow()
{
- QRect geometry(80, 80, 40, 40);
+ // Some platforms enforce minimum widths for windows, which can cause extra resize
+ // events, so set the width to suitably large value to avoid those.
+ QRect geometry(80, 80, 300, 40);
Window window;
window.setGeometry(geometry);
window.show();
+ QCoreApplication::processEvents();
QTRY_COMPARE(window.received(QEvent::Show), 1);
QTRY_COMPARE(window.received(QEvent::Resize), 1);
@@ -157,12 +161,15 @@ void tst_QWindow::eventOrderOnShow()
void tst_QWindow::positioning()
{
- QRect geometry(80, 80, 40, 40);
+ // Some platforms enforce minimum widths for windows, which can cause extra resize
+ // events, so set the width to suitably large value to avoid those.
+ QRect geometry(80, 80, 300, 40);
Window window;
window.setGeometry(geometry);
QCOMPARE(window.geometry(), geometry);
window.show();
+ QCoreApplication::processEvents();
QTRY_COMPARE(window.received(QEvent::Resize), 1);
QTRY_VERIFY(window.received(QEvent::Expose) > 0);
@@ -176,12 +183,11 @@ void tst_QWindow::positioning()
QPoint originalFramePos = window.framePos();
window.setWindowState(Qt::WindowFullScreen);
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "QTBUG-24904 - Too many resize events on setting window state", Continue);
-#endif
+ QCoreApplication::processEvents();
QTRY_COMPARE(window.received(QEvent::Resize), 2);
window.setWindowState(Qt::WindowNoState);
+ QCoreApplication::processEvents();
QTRY_COMPARE(window.received(QEvent::Resize), 3);
QTRY_COMPARE(originalPos, window.pos());
@@ -218,12 +224,14 @@ void tst_QWindow::isExposed()
window.setGeometry(geometry);
QCOMPARE(window.geometry(), geometry);
window.show();
+ QCoreApplication::processEvents();
QTRY_VERIFY(window.received(QEvent::Expose) > 0);
QTRY_VERIFY(window.isExposed());
window.hide();
+ QCoreApplication::processEvents();
#ifdef Q_OS_MAC
QEXPECT_FAIL("", "This test fails on Mac OS X, see QTBUG-23059", Abort);
#endif
@@ -235,8 +243,11 @@ void tst_QWindow::isExposed()
void tst_QWindow::isActive()
{
Window window;
- window.setGeometry(80, 80, 40, 40);
+ // Some platforms enforce minimum widths for windows, which can cause extra resize
+ // events, so set the width to suitably large value to avoid those.
+ window.setGeometry(80, 80, 300, 40);
window.show();
+ QCoreApplication::processEvents();
QTRY_VERIFY(window.isExposed());
QTRY_COMPARE(window.received(QEvent::Resize), 1);
@@ -256,6 +267,7 @@ void tst_QWindow::isActive()
QVERIFY(child.isActive());
// parent shouldn't receive new resize events from child being shown
+ QCoreApplication::processEvents();
QTRY_COMPARE(window.received(QEvent::Resize), 1);
QTRY_COMPARE(window.received(QEvent::FocusIn), 1);
QTRY_COMPARE(window.received(QEvent::FocusOut), 1);
@@ -266,12 +278,13 @@ void tst_QWindow::isActive()
Window dialog;
dialog.setTransientParent(&window);
- dialog.setGeometry(110, 110, 30, 30);
+ dialog.setGeometry(110, 110, 300, 30);
dialog.show();
dialog.requestActivateWindow();
QTRY_VERIFY(dialog.isExposed());
+ QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::Resize), 1);
QTRY_VERIFY(QGuiApplication::focusWindow() == &dialog);
QVERIFY(dialog.isActive());
@@ -285,6 +298,7 @@ void tst_QWindow::isActive()
window.requestActivateWindow();
QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1);
QTRY_COMPARE(window.received(QEvent::FocusIn), 2);
@@ -314,6 +328,8 @@ public:
mouseSequenceSignature += 'p';
mousePressButton = event->button();
mousePressScreenPos = event->screenPos();
+ if (spinLoopWhenPressed)
+ QCoreApplication::processEvents();
}
}
void mouseReleaseEvent(QMouseEvent *event) {
@@ -329,6 +345,7 @@ public:
if (ignoreMouse) {
event->ignore();
} else {
+ ++mouseMovedCount;
mouseMoveButton = event->button();
mouseMoveScreenPos = event->screenPos();
}
@@ -352,6 +369,8 @@ public:
switch (points.at(i).state()) {
case Qt::TouchPointPressed:
++touchPressedCount;
+ if (spinLoopWhenPressed)
+ QCoreApplication::processEvents();
break;
case Qt::TouchPointReleased:
++touchReleasedCount;
@@ -365,7 +384,7 @@ public:
}
}
void resetCounters() {
- mousePressedCount = mouseReleasedCount = mouseDoubleClickedCount = 0;
+ mousePressedCount = mouseReleasedCount = mouseMovedCount = mouseDoubleClickedCount = 0;
mouseSequenceSignature = QString();
touchPressedCount = touchReleasedCount = touchMovedCount = 0;
}
@@ -374,18 +393,21 @@ public:
keyPressCode = keyReleaseCode = 0;
mousePressButton = mouseReleaseButton = mouseMoveButton = 0;
ignoreMouse = ignoreTouch = false;
+ spinLoopWhenPressed = false;
resetCounters();
}
int keyPressCode, keyReleaseCode;
int mousePressButton, mouseReleaseButton, mouseMoveButton;
- int mousePressedCount, mouseReleasedCount, mouseDoubleClickedCount;
+ int mousePressedCount, mouseReleasedCount, mouseMovedCount, mouseDoubleClickedCount;
QString mouseSequenceSignature;
QPointF mousePressScreenPos, mouseMoveScreenPos;
int touchPressedCount, touchReleasedCount, touchMovedCount;
QEvent::Type touchEventType;
bool ignoreMouse, ignoreTouch;
+
+ bool spinLoopWhenPressed;
};
void tst_QWindow::testInputEvents()
@@ -839,5 +861,49 @@ void tst_QWindow::windowModality()
QCOMPARE(spy.count(), 3);
}
+void tst_QWindow::inputReentrancy()
+{
+ InputTestWindow window;
+ window.spinLoopWhenPressed = true;
+
+ window.setGeometry(80, 80, 40, 40);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+
+ // Queue three events.
+ QPointF local(12, 34);
+ QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::LeftButton);
+ local += QPointF(2, 2);
+ QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::NoButton);
+ // Process them. However, the event handler for the press will also call
+ // processEvents() so the move and release will be delivered before returning
+ // from mousePressEvent(). The point is that no events should get lost.
+ QCoreApplication::processEvents();
+ QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
+ QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
+ QCOMPARE(window.mousePressedCount, 1);
+ QCOMPARE(window.mouseMovedCount, 1);
+ QCOMPARE(window.mouseReleasedCount, 1);
+
+ // Now the same for touch.
+ QList<QWindowSystemInterface::TouchPoint> points;
+ QWindowSystemInterface::TouchPoint tp1;
+ tp1.id = 1;
+ tp1.state = Qt::TouchPointPressed;
+ tp1.area = QRectF(10, 10, 4, 4);
+ points << tp1;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointMoved;
+ points[0].area = QRectF(20, 20, 8, 8);
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ QCoreApplication::processEvents();
+ QCOMPARE(window.touchPressedCount, 1);
+ QCOMPARE(window.touchMovedCount, 1);
+ QCOMPARE(window.touchReleasedCount, 1);
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow)
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index 698470ac60..c89d10a543 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -3358,13 +3358,13 @@ void tst_QMatrixNxN::properties()
QMatrix4x4 m1(uniqueValues4);
obj.setMatrix(m1);
- QMatrix4x4 m2 = qVariantValue<QMatrix4x4>(obj.property("matrix"));
+ QMatrix4x4 m2 = qvariant_cast<QMatrix4x4>(obj.property("matrix"));
QVERIFY(isSame(m2, uniqueValues4));
QMatrix4x4 m3(transposedValues4);
- obj.setProperty("matrix", qVariantFromValue(m3));
+ obj.setProperty("matrix", QVariant::fromValue(m3));
- m2 = qVariantValue<QMatrix4x4>(obj.property("matrix"));
+ m2 = qvariant_cast<QMatrix4x4>(obj.property("matrix"));
QVERIFY(isSame(m2, transposedValues4));
}
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 1690afcac4..a4e1f940fc 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -855,16 +855,16 @@ void tst_QQuaternion::properties()
obj.setQuaternion(QQuaternion(6.0f, 7.0f, 8.0f, 9.0f));
- QQuaternion q = qVariantValue<QQuaternion>(obj.property("quaternion"));
+ QQuaternion q = qvariant_cast<QQuaternion>(obj.property("quaternion"));
QCOMPARE(q.scalar(), (qreal)6.0f);
QCOMPARE(q.x(), (qreal)7.0f);
QCOMPARE(q.y(), (qreal)8.0f);
QCOMPARE(q.z(), (qreal)9.0f);
obj.setProperty("quaternion",
- qVariantFromValue(QQuaternion(-6.0f, -7.0f, -8.0f, -9.0f)));
+ QVariant::fromValue(QQuaternion(-6.0f, -7.0f, -8.0f, -9.0f)));
- q = qVariantValue<QQuaternion>(obj.property("quaternion"));
+ q = qvariant_cast<QQuaternion>(obj.property("quaternion"));
QCOMPARE(q.scalar(), (qreal)-6.0f);
QCOMPARE(q.x(), (qreal)-7.0f);
QCOMPARE(q.y(), (qreal)-8.0f);
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index 067773074e..72a4ecef97 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -2077,38 +2077,38 @@ void tst_QVectorND::properties()
obj.setVector3D(QVector3D(3.0f, 4.0f, 5.0f));
obj.setVector4D(QVector4D(6.0f, 7.0f, 8.0f, 9.0f));
- QVector2D v2 = qVariantValue<QVector2D>(obj.property("vector2D"));
+ QVector2D v2 = qvariant_cast<QVector2D>(obj.property("vector2D"));
QCOMPARE(v2.x(), (qreal)1.0f);
QCOMPARE(v2.y(), (qreal)2.0f);
- QVector3D v3 = qVariantValue<QVector3D>(obj.property("vector3D"));
+ QVector3D v3 = qvariant_cast<QVector3D>(obj.property("vector3D"));
QCOMPARE(v3.x(), (qreal)3.0f);
QCOMPARE(v3.y(), (qreal)4.0f);
QCOMPARE(v3.z(), (qreal)5.0f);
- QVector4D v4 = qVariantValue<QVector4D>(obj.property("vector4D"));
+ QVector4D v4 = qvariant_cast<QVector4D>(obj.property("vector4D"));
QCOMPARE(v4.x(), (qreal)6.0f);
QCOMPARE(v4.y(), (qreal)7.0f);
QCOMPARE(v4.z(), (qreal)8.0f);
QCOMPARE(v4.w(), (qreal)9.0f);
obj.setProperty("vector2D",
- qVariantFromValue(QVector2D(-1.0f, -2.0f)));
+ QVariant::fromValue(QVector2D(-1.0f, -2.0f)));
obj.setProperty("vector3D",
- qVariantFromValue(QVector3D(-3.0f, -4.0f, -5.0f)));
+ QVariant::fromValue(QVector3D(-3.0f, -4.0f, -5.0f)));
obj.setProperty("vector4D",
- qVariantFromValue(QVector4D(-6.0f, -7.0f, -8.0f, -9.0f)));
+ QVariant::fromValue(QVector4D(-6.0f, -7.0f, -8.0f, -9.0f)));
- v2 = qVariantValue<QVector2D>(obj.property("vector2D"));
+ v2 = qvariant_cast<QVector2D>(obj.property("vector2D"));
QCOMPARE(v2.x(), (qreal)-1.0f);
QCOMPARE(v2.y(), (qreal)-2.0f);
- v3 = qVariantValue<QVector3D>(obj.property("vector3D"));
+ v3 = qvariant_cast<QVector3D>(obj.property("vector3D"));
QCOMPARE(v3.x(), (qreal)-3.0f);
QCOMPARE(v3.y(), (qreal)-4.0f);
QCOMPARE(v3.z(), (qreal)-5.0f);
- v4 = qVariantValue<QVector4D>(obj.property("vector4D"));
+ v4 = qvariant_cast<QVector4D>(obj.property("vector4D"));
QCOMPARE(v4.x(), (qreal)-6.0f);
QCOMPARE(v4.y(), (qreal)-7.0f);
QCOMPARE(v4.z(), (qreal)-8.0f);
diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro
index d0af96df37..ee1b1e39bc 100644
--- a/tests/auto/gui/qopengl/qopengl.pro
+++ b/tests/auto/gui/qopengl/qopengl.pro
@@ -8,5 +8,4 @@ QT += gui gui-private core-private testlib
SOURCES += tst_qopengl.cpp
-mac: CONFIG += insignificant_test # QTBUG-23061
win32:CONFIG += insignificant_test # QTBUG-24192
diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
index c853aaa100..8be6fe22d1 100644
--- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
+++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
@@ -9,5 +9,3 @@ wince* {
additionalFiles.path = .
DEPLOYMENT += additionalFiles
}
-
-mac: CONFIG += insignificant_test # QTBUG-23062
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index 7a1cc53c57..9510b9719a 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -265,7 +265,10 @@ void tst_QFontDatabase::addAppFont()
QVERIFY(QFontDatabase::removeApplicationFont(id));
QCOMPARE(fontDbChangedSpy.count(), 2);
- QVERIFY(db.families() == oldFamilies);
+#ifdef Q_OS_MAC
+ QEXPECT_FAIL("font file", "QTBUG-23062", Continue);
+#endif
+ QCOMPARE(db.families(), oldFamilies);
}
QTEST_MAIN(tst_QFontDatabase)
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index 4dbdf9a4f1..8144696e8e 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -233,7 +233,7 @@ void tst_QFontMetrics::bypassShaping()
template<class FontMetrics> void elidedMultiLength_helper()
{
- QString text1 = "Long Text 1\x9cShorter\x9csmall";
+ QString text1 = QLatin1String("Long Text 1\x9cShorter\x9csmall");
QString text1_long = "Long Text 1";
QString text1_short = "Shorter";
QString text1_small = "small";
diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro
index 8cac4abc57..149ad6442e 100644
--- a/tests/auto/gui/text/qrawfont/qrawfont.pro
+++ b/tests/auto/gui/text/qrawfont/qrawfont.pro
@@ -9,5 +9,3 @@ SOURCES += \
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
TESTDATA += testfont_bold_italic.ttf testfont.ttf
-
-win32:CONFIG += insignificant_test # QTBUG-24197
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index 99e53f3261..a3fe7b5368 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -295,6 +295,15 @@ void tst_QRawFont::advances()
bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions();
QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices);
for (int i=0; i<glyphIndices.size(); ++i) {
+#ifdef Q_OS_WIN
+ // In Windows, freetype engine returns advance of 9 when full hinting is used (default) for
+ // some of the glyphs.
+ if (font_d->fontEngine->type() == QFontEngine::Freetype
+ && (hintingPreference == QFont::PreferFullHinting || hintingPreference == QFont::PreferDefaultHinting)
+ && (i == 0 || i == 5)) {
+ QEXPECT_FAIL("", "Advance for some glyphs is not the expected with Windows Freetype engine (9 instead of 8)", Continue);
+ }
+#endif
QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0));
if (supportsSubPixelPositions)
QVERIFY(advances.at(i).x() > 8.0);
@@ -879,7 +888,7 @@ void tst_QRawFont::multipleRawFontsFromData()
testFontBoldItalic.loadFromData(file.readAll(), 11, QFont::PreferDefaultHinting);
QVERIFY(testFont.familyName() != (testFontBoldItalic.familyName())
- || testFont.styleName() != (testFontBoldItalic.styleName()));
+ || testFont.style() != (testFontBoldItalic.style()));
}
#endif // QT_NO_RAWFONT
diff --git a/tests/auto/gui/text/qstatictext/qstatictext.pro b/tests/auto/gui/text/qstatictext/qstatictext.pro
index 67f2e047a4..9abc3245ed 100644
--- a/tests/auto/gui/text/qstatictext/qstatictext.pro
+++ b/tests/auto/gui/text/qstatictext/qstatictext.pro
@@ -3,5 +3,3 @@ TARGET = tst_qstatictext
QT += testlib
QT += core core-private gui gui-private
SOURCES += tst_qstatictext.cpp
-
-mac: CONFIG += insignificant_test # QTBUG-23063
diff --git a/tests/auto/gui/text/qtextlayout/qtextlayout.pro b/tests/auto/gui/text/qtextlayout/qtextlayout.pro
index f35239bc6a..7addbe88dc 100644
--- a/tests/auto/gui/text/qtextlayout/qtextlayout.pro
+++ b/tests/auto/gui/text/qtextlayout/qtextlayout.pro
@@ -5,3 +5,5 @@ HEADERS +=
SOURCES += tst_qtextlayout.cpp
DEFINES += QT_COMPILES_IN_HARFBUZZ
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
+
+mac:CONFIG+=insignificant_test # QTBUG-23050
diff --git a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro
index 516fa67f11..6dcb1b44a0 100644
--- a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro
+++ b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro
@@ -6,5 +6,3 @@ QT += core-private gui-private testlib
HEADERS +=
SOURCES += tst_qtextscriptengine.cpp
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
-
-mac: CONFIG += insignificant_test # QTBUG-23064
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
index d566f0a20d..5a53f09e77 100644
--- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -1173,11 +1173,12 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675()
QFont font("Monaco");
QTextLayout layout(s, font);
- QTextEngine *e = layout.d;
+ QTextEngine *e = layout.engine();
e->itemize();
e->shape(0);
QVERIFY(e->layoutData->items[0].num_glyphs == 4);
+ QEXPECT_FAIL("", "QTBUG-23064", Abort);
QVERIFY(e->layoutData->glyphLayout.advances_y[2] > 0);
#elif defined(Q_WS_X11)
QFontDatabase db;
@@ -1317,6 +1318,9 @@ void tst_QTextScriptEngine::thaiWithZWJ()
QCOMPARE(logClusters[i], ushort(i));
for (int i = 0; i < 10; i++)
QCOMPARE(logClusters[i+7], ushort(0));
+#ifdef Q_OS_MAC
+ QEXPECT_FAIL("", "QTBUG-23064", Abort);
+#endif
QCOMPARE(logClusters[17], ushort(1));
// The only characters that we should be hiding are the ZWJ and ZWNJ characters in position 1
diff --git a/tests/auto/gui/text/text.pro b/tests/auto/gui/text/text.pro
index c24fe7553d..5055ab61a3 100644
--- a/tests/auto/gui/text/text.pro
+++ b/tests/auto/gui/text/text.pro
@@ -31,7 +31,3 @@ win32:SUBDIRS -= qtextpiecetable
qstatictext \
qtextlayout \
qtextpiecetable \
-
-mac {
- qtextlayout.CONFIG = no_check_target # QTBUG-23050
-}