diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 4ce77ddee9..6514ed589c 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -1063,15 +1063,15 @@ void tst_QDateTimeEdit::enterKey() QCOMPARE(testWidget->lineEdit()->selectedText(), QString("9")); QCOMPARE(testWidget->date(), QDate(2004, 5, 9)); + // Current behaviour is that pressing the Enter key in a QDateTimeEdit + // causes the dateChanged() signal to be emitted, even if the date + // wasn't actually changed. While this behaviour is questionable, + // we include this test so a change to the behaviour can't go unnoticed. QSignalSpy enterSpy(testWidget, SIGNAL(dateChanged(const QDate &))); QTest::keyClick(testWidget, Qt::Key_Enter); QCOMPARE(enterSpy.count(), 1); - -#if 0 QVariantList list = enterSpy.takeFirst(); - QCOMPARE(list.at(0).toDate(), QDate(2004, 9, 15)); -#endif - + QCOMPARE(list.at(0).toDate(), QDate(2004, 5, 9)); } void tst_QDateTimeEdit::specialValueText()