summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-09-22 09:15:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-09-22 14:26:26 +0000
commitd417f81f28039b9165780f937c08ac9b2b92127d (patch)
tree1b986b4a758af76487669f00e299c89ddad8008c /tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
parent7edd10e6cc215c419c2cb492ffca997faa520c4c (diff)
QAbstractSpinBox::inputMethodQuery(): Consider input method hints set on the spin box.
The derived classes (QSpinBox, QDoubleSpinBox, QDateTimeEdit, QTimeEdit) set various input method hints on the spin box in the init() methods of their private classes which did not have any effect since QAbstractSpinBox::inputMethodQuery() was implemented to return the hints of the embedded QLineEdit only. Change it so that hints set on the QAbstractSpinBox are also considered. Change-Id: I76b7c4d3e0869589c110cf3a0b2c3f94201db5d5 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp')
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index e8a0916dc5..d41398046f 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -285,6 +285,7 @@ typedef QList<Qt::Key> KeyList;
void tst_QDateTimeEdit::getSetCheck()
{
QDateTimeEdit obj1;
+ QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
obj1.setDisplayFormat("dd/MM/yyyy hh:mm:ss.zzz d/M/yy h:m:s.z AP");
// Section QDateTimeEdit::currentSection()
// void QDateTimeEdit::setCurrentSection(Section)
@@ -306,6 +307,11 @@ void tst_QDateTimeEdit::getSetCheck()
QCOMPARE(QDateTimeEdit::MonthSection, obj1.currentSection());
obj1.setCurrentSection(QDateTimeEdit::YearSection);
QCOMPARE(QDateTimeEdit::YearSection, obj1.currentSection());
+
+ QDateEdit dateEdit;
+ QCOMPARE(dateEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
+ QTimeEdit timeEdit;
+ QCOMPARE(timeEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
}
tst_QDateTimeEdit::tst_QDateTimeEdit()