diff options
author | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-08-04 13:37:00 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-08-11 07:46:12 +0000 |
commit | 7f0f6380b132be76e6d5293b7b357918b7cb3d56 (patch) | |
tree | aae05a4d4c2a07abc0e680ff20947eee39ae5801 /src/widgets/widgets | |
parent | 22e752bada2b1f83f94b95c3473b6c3fe13cd7c5 (diff) |
QComboBox: make editable comboboxes usable with input methods
QComboBox uses a QLineEdit for text editing. But while editing, the
combobox is the widget having focus, not the line edit. Instead the
combobox forwards all the IM events to the line edit internally. This
causes a problem since the line edit will not be able to update the
platforms IM state in QWidget::updateMicroFocus() since it doesn't
have focus. The result will be that the platforms IM state will
get out of sync with the QLineEdit.
This patch will add the missing connections that lets QComboBox
update the platforms IM state when the inner QLineEdit signals
that its needed.
Change-Id: Ic3e0fdbf155d4dbeab31e2cd859f6e425ae87375
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 17762eb39d..4840b75c1b 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1771,6 +1771,8 @@ void QComboBox::setLineEdit(QLineEdit *edit) connect(d->lineEdit, SIGNAL(editingFinished()), this, SLOT(_q_editingFinished())); connect(d->lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(editTextChanged(QString))); connect(d->lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(currentTextChanged(QString))); + connect(d->lineEdit, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(updateMicroFocus())); + connect(d->lineEdit, SIGNAL(selectionChanged()), this, SLOT(updateMicroFocus())); d->lineEdit->setFrame(false); d->lineEdit->setContextMenuPolicy(Qt::NoContextMenu); d->updateFocusPolicy(); |