From 40e6b1d0b8c1804dfb33032fa70b6604b91f6f90 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 21 Jan 2013 11:08:47 +1000 Subject: 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 --- src/widgets/kernel/qwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets') 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 -- cgit v1.2.3