diff options
author | BogDan Vatra <bogdan@kde.org> | 2015-07-07 16:23:21 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2015-07-30 07:06:27 +0000 |
commit | d800047dc57a773149545d3705a70419884feb46 (patch) | |
tree | 0703f95ff37d332a47bb14935f79ec10be1d1b4b | |
parent | 17caa9419045f88baceae6555deadfcf24f5d1b1 (diff) |
QLineEdit should inherit the input methods from QComboBox.
Task-number: QTBUG-39088
Change-Id: I4dfe9a052c20a4cb0a9d6b0d3337cb5095a3694f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 1 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index cc4c3416f0..17762eb39d 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1764,6 +1764,7 @@ void QComboBox::setLineEdit(QLineEdit *edit) delete d->lineEdit; d->lineEdit = edit; + qt_widget_private(d->lineEdit)->inheritsInputMethodHints = 1; if (d->lineEdit->parent() != this) d->lineEdit->setParent(this); connect(d->lineEdit, SIGNAL(returnPressed()), this, SLOT(_q_returnPressed())); diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index c409698ec0..7824172812 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -164,6 +164,7 @@ private slots: void keyboardSelection(); void setCustomModelAndView(); void updateDelegateOnEditableChange(); + void task_QTBUG_39088_inputMethodHints(); }; class MyAbstractItemDelegate : public QAbstractItemDelegate @@ -3169,5 +3170,13 @@ void tst_QComboBox::updateDelegateOnEditableChange() } } +void tst_QComboBox::task_QTBUG_39088_inputMethodHints() +{ + QComboBox box; + box.setEditable(true); + box.setInputMethodHints(Qt::ImhNoPredictiveText); + QCOMPARE(box.lineEdit()->inputMethodHints(), Qt::ImhNoPredictiveText); +} + QTEST_MAIN(tst_QComboBox) #include "tst_qcombobox.moc" |