summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@jollamobile.com>2013-01-21 01:08:47 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-22 14:26:42 (GMT)
commit6873437085a8fe669b12f8f1f2cfee872839d4ec (patch)
tree5099038e8731955e4c65874a047df6698b9648af /src/gui/kernel/qwidget.cpp
parent263d733ac70403c488d67b1aab120167f156c3f4 (diff)
downloadQt-6873437085a8fe669b12f8f1f2cfee872839d4ec.zip
Qt-6873437085a8fe669b12f8f1f2cfee872839d4ec.tar.gz
Qt-6873437085a8fe669b12f8f1f2cfee872839d4ec.tar.bz2
Don't update the input method if the im hints haven't changed.
Depending on the implementation updating an input method can be expensive and various widgets will at times call setInputMethodHints with unchanged hints. QGraphicsView being a notable offender due to the complexity of the circumstances in which the hints can change. Skipping the update here ensures the input method isn't updated unnecessarily for all widgets. Task-number: QTBUG-19854 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> (cherry picked from commit 40e6b1d0b8c1804dfb33032fa70b6604b91f6f90) Change-Id: I36ae35585ee20a4e01ca0d62c71e896dbdb51a3f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index b770758..b2ffac7 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -9431,6 +9431,8 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
#ifndef QT_NO_IM
Q_D(QWidget);
+ if (d->imHints == hints)
+ return;
d->imHints = hints;
// Optimization to update input context only it has already been created.
if (d->ic || qApp->d_func()->inputContext) {