summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@jollamobile.com>2013-01-21 11:08:47 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-21 09:32:58 +0100
commit40e6b1d0b8c1804dfb33032fa70b6604b91f6f90 (patch)
tree5472c4ec4034bc95027bce5de02c655823ff52e3 /src
parent3e8996df2a2016fd0f80cbe44e72f556964654ce (diff)
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 Change-Id: I36ae35585ee20a4e01ca0d62c71e896dbdb51a3f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 432db2b294..3b9e889a9c 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -8846,6 +8846,8 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
#ifndef QT_NO_IM
Q_D(QWidget);
+ if (d->imHints == hints)
+ return;
d->imHints = hints;
qApp->inputMethod()->update(Qt::ImHints);
#endif //QT_NO_IM