summaryrefslogtreecommitdiffstats
path: root/src/widgets
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 /src/widgets
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 'src/widgets')
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index c96c779d6a..ba4bbe40a8 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -720,7 +720,16 @@ void QAbstractSpinBox::interpretText()
QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery query) const
{
Q_D(const QAbstractSpinBox);
- return d->edit->inputMethodQuery(query);
+ const QVariant lineEditValue = d->edit->inputMethodQuery(query);
+ switch (query) {
+ case Qt::ImHints:
+ if (const int hints = inputMethodHints())
+ return QVariant(hints | lineEditValue.toInt());
+ break;
+ default:
+ break;
+ }
+ return lineEditValue;
}
/*!