From d417f81f28039b9165780f937c08ac9b2b92127d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 22 Sep 2015 09:15:33 +0200 Subject: 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 Reviewed-by: Liang Qi --- tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/widgets/widgets/qspinbox') diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 05dd834c76..34b05c5291 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -165,6 +165,7 @@ Q_DECLARE_METATYPE(QLocale::Country) void tst_QSpinBox::getSetCheck() { QSpinBox obj1; + QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhDigitsOnly))); // int QSpinBox::singleStep() // void QSpinBox::setSingleStep(int) obj1.setSingleStep(0); @@ -202,6 +203,7 @@ void tst_QSpinBox::getSetCheck() QCOMPARE(INT_MAX, obj1.value()); QDoubleSpinBox obj2; + QCOMPARE(obj2.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhFormattedNumbersOnly))); // double QDoubleSpinBox::singleStep() // void QDoubleSpinBox::setSingleStep(double) obj2.setSingleStep(0.0); -- cgit v1.2.3