diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-08-06 16:32:18 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-08-07 10:12:05 +0000 |
commit | 58e3e32adf227e91771fa421f2657f758ef1411b (patch) | |
tree | bdf32aee005f367a692ba3406bab2e1693f90e34 /tests/auto/widgets/widgets/qdatetimeedit | |
parent | 86bea797dcef69fcc6634ef901ec612eb4c104bd (diff) |
tst_qdatetimeedit: hide testWidget when creating widgets on the stack
The majority of the test reuses testWidget. While this may be faster
than creating a QDateTimeEdit instance on the stack for each test,
it introduces issues when certain properties aren't unset when cleaning
up. This happens easily when new tests are introduced which rely on
certain properties, for example.
Rather than making the newly introduced step-modifier-related tests
use testWidget, this patch goes with the simpler option of hiding
testWidget, just like other tests currently do.
Eventually we should probably switch to using local instances
everywhere.
Task-number: QTBUG-69492
Change-Id: I4d5625be0b7c72db793346f43fe3a7e7c1241f13
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets/qdatetimeedit')
-rw-r--r-- | tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 3c7a297f64..6540773781 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -4103,6 +4103,9 @@ void tst_QDateTimeEdit::stepModifierKeys() QFETCH(QTestEventList, keys); QFETCH(QDate, expectedDate); + // This can interfere with our stuff. + testWidget->hide(); + QDateTimeEdit edit(0); edit.setDate(startDate); edit.show(); @@ -4202,6 +4205,8 @@ void tst_QDateTimeEdit::stepModifierButtons() QFETCH(QTime, startTime); QFETCH(QTime, expectedTime); + testWidget->hide(); + EditorDateEdit edit(0); edit.setTime(startTime); edit.show(); @@ -4287,6 +4292,8 @@ void tst_QDateTimeEdit::stepModifierPressAndHold() const QDate startDate(2000, 1, 1); + testWidget->hide(); + EditorDateEdit edit(0); edit.setDate(startDate); |