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>
This commit is contained in:
Andrew den Exter 2013-01-21 11:08:47 +10:00 committed by The Qt Project
parent 3e8996df2a
commit 40e6b1d0b8

View File

@ -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