summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp6
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h1
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp33
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp22
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp1
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp2
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.tap8
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity4
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.xml4
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp5
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp37
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp1
-rw-r--r--tests/auto/widgets/itemviews/qtableview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp1
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp13
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp4
21 files changed, 108 insertions, 47 deletions
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index a53501b9dd..6adb393ddd 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -928,6 +928,12 @@ void tst_QCoreApplication::threadedEventDelivery()
thread.start();
QVERIFY(thread.wait(1000));
QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived);
+
+}
+
+void tst_QCoreApplication::testTrWithPercantegeAtTheEnd()
+{
+ QCoreApplication::translate("testcontext", "this will crash%", "testdisamb", 3);
}
#if QT_CONFIG(library)
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
index 105cca5174..2a23cf0751 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
@@ -59,6 +59,7 @@ private slots:
void applicationEventFilters_auxThread();
void threadedEventDelivery_data();
void threadedEventDelivery();
+ void testTrWithPercantegeAtTheEnd();
#if QT_CONFIG(library)
void addRemoveLibPaths();
#endif
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index c78cd2276f..e8ed22e427 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -319,10 +319,18 @@ class tst_QString : public QObject
template <typename ArgType>
void insert_impl() const { insert_impl<ArgType, QString &(QString::*)(int, const ArgType&)>(); }
void insert_data(bool emptyIsNoop = false);
+
+ class TransientDefaultLocale
+ {
+ const QLocale prior; // Records what *was* the default before we set it.
+ public:
+ TransientDefaultLocale(const QLocale &transient) { revise(transient); }
+ void revise(const QLocale &transient) { QLocale::setDefault(transient); }
+ ~TransientDefaultLocale() { QLocale::setDefault(prior); }
+ };
+
public:
tst_QString();
-public slots:
- void cleanup();
private slots:
void fromStdString();
void toStdString();
@@ -654,11 +662,6 @@ tst_QString::tst_QString()
QTextCodec::setCodecForLocale(QTextCodec::codecForName("ISO 8859-1"));
}
-void tst_QString::cleanup()
-{
- QLocale::setDefault(QString("C"));
-}
-
void tst_QString::remove_uint_uint_data()
{
replace_uint_uint_data();
@@ -4750,7 +4753,7 @@ void tst_QString::arg()
is all messed up, because Qt Test itself uses QString::arg().
*/
- QLocale::setDefault(QString("de_DE"));
+ TransientDefaultLocale transient(QString("de_DE"));
QString s4( "[%0]" );
QString s5( "[%1]" );
@@ -4898,13 +4901,11 @@ void tst_QString::arg()
QCOMPARE(QString("%1").arg(-1., 3, 'g', -1, QChar('x')), QLatin1String("x-1"));
QCOMPARE(QString("%1").arg(-100., 3, 'g', -1, QChar('x')), QLatin1String("-100"));
- QLocale::setDefault(QString("ar"));
+ transient.revise(QString("ar"));
QCOMPARE( QString("%L1").arg(12345.6789, 10, 'g', 7, QLatin1Char('0')),
QString::fromUtf8("\xd9\xa0\xd9\xa1\xd9\xa2\xd9\xac\xd9\xa3\xd9\xa4\xd9\xa5\xd9\xab\xd9\xa6\xd9\xa8") ); // "٠١٢٬٣٤٥٫٦٨"
QCOMPARE( QString("%L1").arg(123456789, 13, 10, QLatin1Char('0')),
QString("\xd9\xa0\xd9\xa0\xd9\xa1\xd9\xa2\xd9\xa3\xd9\xac\xd9\xa4\xd9\xa5\xd9\xa6\xd9\xac\xd9\xa7\xd9\xa8\xd9\xa9") ); // ٠٠١٢٣٬٤٥٦٬٧٨٩
-
- QLocale::setDefault(QLocale::system());
}
void tst_QString::number()
@@ -6594,14 +6595,14 @@ void tst_QString::arg_locale()
QLocale l(QLocale::English, QLocale::UnitedKingdom);
QString str("*%L1*%L2*");
- QLocale::setDefault(l);
+ TransientDefaultLocale transient(l);
QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
l.setNumberOptions(QLocale::OmitGroupSeparator);
- QLocale::setDefault(l);
+ transient.revise(l);
QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
- QLocale::setDefault(QLocale::C);
+ transient.revise(QLocale::C);
QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
}
@@ -6615,7 +6616,7 @@ void tst_QString::toUpperLower_icu()
QCOMPARE(s.toUpper(), QString::fromLatin1("I"));
QCOMPARE(s.toLower(), QString::fromLatin1("i"));
- QLocale::setDefault(QLocale(QLocale::Turkish, QLocale::Turkey));
+ TransientDefaultLocale transient(QLocale(QLocale::Turkish, QLocale::Turkey));
QCOMPARE(s.toUpper(), QString::fromLatin1("I"));
QCOMPARE(s.toLower(), QString::fromLatin1("i"));
@@ -6639,8 +6640,6 @@ void tst_QString::toUpperLower_icu()
// nothing should happen here
QCOMPARE(l.toLower(sup), sup);
QCOMPARE(l.toLower(QString::fromLatin1("i")), QString::fromLatin1("i"));
-
- // the cleanup function will restore the default locale
}
#endif
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
index 9d6ce78b24..55fff34a8e 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
+++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
@@ -82,6 +82,7 @@ private slots:
void preservePreeditArea();
void task108530();
void avoidUnnecessaryRehighlight();
+ void avoidUnnecessaryDelayedRehighlight();
void noContentsChangedDuringHighlight();
void rehighlight();
void rehighlightBlock();
@@ -475,7 +476,26 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryRehighlight()
QVERIFY(hl->highlighted);
hl->highlighted = false;
- QTRY_VERIFY(!hl->highlighted);
+ QCoreApplication::processEvents();
+ QVERIFY(!hl->highlighted);
+}
+
+void tst_QSyntaxHighlighter::avoidUnnecessaryDelayedRehighlight()
+{
+ // Having text in the document before creating the highlighter starts the delayed rehighlight
+ cursor.insertText("Hello World");
+
+ TestHighlighter *hl = new TestHighlighter(doc);
+ QVERIFY(!hl->highlighted);
+
+ hl->rehighlight();
+ QVERIFY(hl->highlighted);
+
+ hl->highlighted = false;
+ // Process events, including delayed rehighlight emission
+ QCoreApplication::processEvents();
+ // Should be cancelled and no extra rehighlight should be done
+ QVERIFY(!hl->highlighted);
}
void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight()
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 7666bf81e4..053c4b026b 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -924,6 +924,7 @@ void tst_QGL::partialGLWidgetUpdates()
widget.setAutoFillBackground(autoFillBackground);
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ QCoreApplication::processEvents(); // Process all queued paint events
if (widget.format().doubleBuffer() != doubleBufferedContext)
QSKIP("Platform does not support requested format");
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index a65dd0bf8f..abe4325278 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -644,7 +644,7 @@ void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
QByteArray file1Line = file1.readLine();
QByteArray file2Line = file2.readLine();
- if (!file1Line.startsWith("%%CreationDate"))
+ if (!file1Line.contains("CreationDate"))
QCOMPARE(file1Line, file2Line);
}
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml
index 810941d894..85f8fac42a 100644
--- a/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml
@@ -12,7 +12,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSimpleTuple">
-<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (std::tuple<int>{1}): std::tuple(1)
Expected (std::tuple<int>{2}): std::tuple(2)]]></Description>
@@ -20,7 +20,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testTuple">
-<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (tuple1): std::tuple(42, 'Y', "tuple1")
Expected (tuple2): std::tuple(42, 'Y', "tuple2")]]></Description>
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.tap b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap
index 9e007c14e1..a079a9bf40 100644
--- a/tests/auto/testlib/selftests/expected_tuplediagnostics.tap
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap
@@ -10,8 +10,8 @@ not ok 3 - testSimpleTuple()
found: std::tuple(1) (std::tuple<int>{1})
expected: std::tuple(2) (std::tuple<int>{2})
actual: std::tuple(1) (std::tuple<int>{1})
- at: tst_TupleDiagnostics::testSimpleTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53)
- file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
+ at: tst_TupleDiagnostics::testSimpleTuple() (qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53)
+ file: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
line: 53
...
not ok 4 - testTuple()
@@ -22,8 +22,8 @@ not ok 4 - testTuple()
found: std::tuple(42, 'Y', "tuple1") (tuple1)
expected: std::tuple(42, 'Y', "tuple2") (tuple2)
actual: std::tuple(42, 'Y', "tuple1") (tuple1)
- at: tst_TupleDiagnostics::testTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60)
- file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
+ at: tst_TupleDiagnostics::testTuple() (qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60)
+ file: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
line: 60
...
ok 5 - cleanupTestCase()
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity
index a395857c60..7256992518 100644
--- a/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity
@@ -4,10 +4,10 @@
##teamcity[testStarted name='testEmptyTuple()' flowId='tst_TupleDiagnostics']
##teamcity[testFinished name='testEmptyTuple()' flowId='tst_TupleDiagnostics']
##teamcity[testStarted name='testSimpleTuple()' flowId='tst_TupleDiagnostics']
-##teamcity[testFailed name='testSimpleTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (std::tuple<int>{1}): std::tuple(1)|n Expected (std::tuple<int>{2}): std::tuple(2)' flowId='tst_TupleDiagnostics']
+##teamcity[testFailed name='testSimpleTuple()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (std::tuple<int>{1}): std::tuple(1)|n Expected (std::tuple<int>{2}): std::tuple(2)' flowId='tst_TupleDiagnostics']
##teamcity[testFinished name='testSimpleTuple()' flowId='tst_TupleDiagnostics']
##teamcity[testStarted name='testTuple()' flowId='tst_TupleDiagnostics']
-##teamcity[testFailed name='testTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (tuple1): std::tuple(42, |'Y|', "tuple1")|n Expected (tuple2): std::tuple(42, |'Y|', "tuple2")' flowId='tst_TupleDiagnostics']
+##teamcity[testFailed name='testTuple()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (tuple1): std::tuple(42, |'Y|', "tuple1")|n Expected (tuple2): std::tuple(42, |'Y|', "tuple2")' flowId='tst_TupleDiagnostics']
##teamcity[testFinished name='testTuple()' flowId='tst_TupleDiagnostics']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_TupleDiagnostics']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_TupleDiagnostics']
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
index ce568bf6c0..8d121acc83 100644
--- a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
@@ -5,11 +5,11 @@ PASS : tst_TupleDiagnostics::testEmptyTuple()
FAIL! : tst_TupleDiagnostics::testSimpleTuple() Compared values are not the same
Actual (std::tuple<int>{1}): std::tuple(1)
Expected (std::tuple<int>{2}): std::tuple(2)
- Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+ Loc: [qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
FAIL! : tst_TupleDiagnostics::testTuple() Compared values are not the same
Actual (tuple1): std::tuple(42, 'Y', "tuple1")
Expected (tuple2): std::tuple(42, 'Y', "tuple2")
- Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+ Loc: [qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
PASS : tst_TupleDiagnostics::cleanupTestCase()
Totals: 3 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_TupleDiagnostics *********
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.xml b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml
index 4c55a6d393..f32974adb4 100644
--- a/tests/auto/testlib/selftests/expected_tuplediagnostics.xml
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml
@@ -14,7 +14,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSimpleTuple">
-<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (std::tuple<int>{1}): std::tuple(1)
Expected (std::tuple<int>{2}): std::tuple(2)]]></Description>
@@ -22,7 +22,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testTuple">
-<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (tuple1): std::tuple(42, 'Y', "tuple1")
Expected (tuple2): std::tuple(42, 'Y', "tuple2")]]></Description>
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 8f9a8c11a7..24ce598279 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -601,6 +601,11 @@ void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
fd.setDirectory(current.absolutePath());
fd.show();
QVERIFY(QTest::qWaitForWindowActive(&fd));
+
+ // Ensure LayoutRequest event is processed so that the list view
+ // is sorted correctly to have the directory entires at the top.
+ QCoreApplication::processEvents();
+
QListView *list = fd.findChild<QListView*>("listView");
QVERIFY(list);
QTest::keyClick(list, Qt::Key_Down);
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index 95662a49a0..c4b6e22c37 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -313,6 +313,7 @@ void tst_QGraphicsEffect::draw()
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(item->numRepaints > 0);
+ QCoreApplication::processEvents(); // Process all queued paint events
item->reset();
// Make sure installing the effect triggers a repaint.
diff --git a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index e7d26622c9..973a73a4a9 100644
--- a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -183,6 +183,7 @@ void tst_QGraphicsEffectSource::init()
effect->storeDeviceDependentStuff = false;
effect->doNothingInDraw = false;
item->reset();
+ QCoreApplication::processEvents(); // Process all queued paint events
}
void tst_QGraphicsEffectSource::graphicsItem()
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index bd08461544..9a75774927 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -3231,6 +3231,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
EventTester *tester = new EventTester;
scene.addItem(tester);
@@ -4147,11 +4148,9 @@ void tst_QGraphicsItem::ensureVisible()
void tst_QGraphicsItem::cursor()
{
QGraphicsScene scene;
- QWidget topLevel;
- QGraphicsView view(&scene,&topLevel);
- topLevel.showMaximized();
- QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
- view.setFixedSize(topLevel.size());
+ QGraphicsView view(&scene);
+ view.showFullScreen();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QGraphicsRectItem *item1 = scene.addRect(QRectF(-100, 0, 50, 50));
QGraphicsRectItem *item2 = scene.addRect(QRectF(50, 0, 50, 50));
@@ -5074,13 +5073,11 @@ void tst_QGraphicsItem::paint()
QGraphicsView view2(&scene2);
view2.show();
QVERIFY(QTest::qWaitForWindowExposed(&view2));
+ QCoreApplication::processEvents(); // Process all queued paint events
PaintTester tester2;
scene2.addItem(&tester2);
-#ifdef Q_OS_WINRT
- QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
-#endif
//First show one paint
QTRY_COMPARE(tester2.painted, 1);
@@ -6534,11 +6531,9 @@ void tst_QGraphicsItem::ensureUpdateOnTextItem()
QGraphicsView view(&scene);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
TextItem *text1 = new TextItem(QLatin1String("123"));
scene.addItem(text1);
-#ifdef Q_OS_WINRT
- QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
-#endif
QTRY_COMPARE(text1->updates,1);
//same bouding rect but we have to update
@@ -6810,6 +6805,7 @@ void tst_QGraphicsItem::opacity2()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
QTRY_VERIFY(view.repaints >= 1);
#define RESET_REPAINT_COUNTERS \
@@ -6883,6 +6879,7 @@ void tst_QGraphicsItem::opacityZeroUpdates()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
QTRY_VERIFY(view.repaints > 0);
view.reset();
@@ -7275,6 +7272,7 @@ void tst_QGraphicsItem::cacheMode()
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
EventTester *tester = new EventTester;
EventTester *testerChild = new EventTester;
@@ -7454,6 +7452,7 @@ void tst_QGraphicsItem::cacheMode2()
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
EventTester *tester = new EventTester;
scene.addItem(tester);
@@ -7944,6 +7943,7 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption()
rect->startTrack = false;
topLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+ QCoreApplication::processEvents(); // Process all queued paint events
QTRY_VERIFY(rect->repaints > 0);
rect->repaints = 0;
rect->startTrack = true;
@@ -8030,6 +8030,7 @@ void tst_QGraphicsItem::moveItem()
MyGraphicsView view(&scene);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
EventTester *parent = new EventTester;
EventTester *child = new EventTester(parent);
@@ -8108,6 +8109,7 @@ void tst_QGraphicsItem::moveLineItem()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
view.reset();
QRectF brect = item->boundingRect();
@@ -8288,6 +8290,7 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem()
toplevel.resize(300, 300);
toplevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
+ QCoreApplication::processEvents(); // Process all queued paint events
// Confuse the BSP with dummy items.
QGraphicsRectItem *dummy = new QGraphicsRectItem(0, 0, 20, 20);
@@ -11266,6 +11269,7 @@ void tst_QGraphicsItem::QTBUG_6738_missingUpdateWithSetParent()
qApp->setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
QTRY_VERIFY(view.repaints > 0);
// test case #1
@@ -11315,6 +11319,7 @@ void tst_QGraphicsItem::QT_2653_fullUpdateDiscardingOpacityUpdate()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
view.reset();
parentGreen->setOpacity(1.0);
@@ -11348,6 +11353,8 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
origView.show();
QVERIFY(QTest::qWaitForWindowActive(&origView));
+ QCoreApplication::processEvents(); // Process all queued paint events
+
origView.setGeometry(origView.x() + origView.width() + 20, origView.y() + 20,
origView.width(), origView.height());
@@ -11356,9 +11363,6 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
origView.reset();
childYellow->setOpacity(0.0);
-#ifdef Q_OS_WINRT
- QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
-#endif
QTRY_COMPARE(origView.repaints, 1);
view.show();
@@ -11370,6 +11374,10 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
childYellow->setOpacity(1.0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
+
QTRY_COMPARE(origView.repaints, 1);
QTRY_COMPARE(view.repaints, 1);
}
@@ -11505,6 +11513,7 @@ void tst_QGraphicsItem::doNotMarkFullUpdateIfNotInScene()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(view.windowHandle()));
QVERIFY(QTest::qWaitForWindowActive(view.windowHandle()));
+ QCoreApplication::processEvents(); // Process all queued paint events
view.activateWindow();
QTRY_VERIFY(view.isActiveWindow());
QTRY_VERIFY(view.repaints >= 1);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 838b1f4be6..48488abfb8 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -4318,6 +4318,7 @@ void tst_QGraphicsScene::removeFullyTransparentItem()
view.show();
qApp->setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCoreApplication::processEvents(); // Process all queued paint events
// NB! The parent has the ItemHasNoContents flag set, which means
// the parent itself doesn't generate any update requests, only the
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 3dc110298a..55139ff99a 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -1650,6 +1650,7 @@ void tst_QGraphicsView::itemsInRect_cosmeticAdjust()
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(rect->numPaints > 0);
+ QCoreApplication::processEvents(); // Process all queued paint events
rect->numPaints = 0;
if (updateRect.isNull())
view.viewport()->update();
diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
index fc231a4e30..be90475a6f 100644
--- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
@@ -1,2 +1,4 @@
[moveCursorBiggerJump]
osx
+[columnViewportPosition]
+winrt # QTBUG-72853
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 8c93df9073..adb2c54751 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -3368,6 +3368,7 @@ void tst_QTreeWidget::setChildIndicatorPolicy()
treeWidget.setItemDelegate(&delegate);
treeWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&treeWidget));
+ QCoreApplication::processEvents(); // Process all queued paint events
QTreeWidgetItem *item = new QTreeWidgetItem(QStringList("Hello"));
treeWidget.insertTopLevelItem(0, item);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 360e6986f6..3b9c9060fa 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -166,6 +166,7 @@ private slots:
void getSetCheck();
void fontPropagation();
void fontPropagation2();
+ void fontPropagation3();
void palettePropagation();
void palettePropagation2();
void enabledPropagation();
@@ -819,6 +820,18 @@ void tst_QWidget::fontPropagation2()
QVERIFY(child5->font().italic());
}
+void tst_QWidget::fontPropagation3()
+{
+ QWidget parent;
+ QWidget *child = new QWidget(&parent);
+ parent.setFont(QFont("Monospace", 9));
+ QImage image(32, 32, QImage::Format_RGB32);
+ QPainter p(&image);
+ p.setFont(child->font());
+ QCOMPARE(p.font().family(), child->font().family());
+ QCOMPARE(p.font().pointSize(), child->font().pointSize());
+}
+
void tst_QWidget::palettePropagation()
{
QScopedPointer<QWidget> testWidget(new QWidget);
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 03f24ba151..0e5c40f1b6 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -741,9 +741,9 @@ void tst_QStyleSheetStyle::fontPropagation()
QCOMPARE(FONTSIZE(pb), 20);
QWidget window;
- window.setStyleSheet("* { font-size: 10pt }");
+ window.setStyleSheet("* { font-size: 9pt }");
pb.setParent(&window);
- QCOMPARE(FONTSIZE(pb), 10);
+ QCOMPARE(FONTSIZE(pb), 9);
window.setStyleSheet("");
QCOMPARE(FONTSIZE(pb), buttonFontSize);