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:
parent
3e8996df2a
commit
40e6b1d0b8
@ -8846,6 +8846,8 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
|
|||||||
{
|
{
|
||||||
#ifndef QT_NO_IM
|
#ifndef QT_NO_IM
|
||||||
Q_D(QWidget);
|
Q_D(QWidget);
|
||||||
|
if (d->imHints == hints)
|
||||||
|
return;
|
||||||
d->imHints = hints;
|
d->imHints = hints;
|
||||||
qApp->inputMethod()->update(Qt::ImHints);
|
qApp->inputMethod()->update(Qt::ImHints);
|
||||||
#endif //QT_NO_IM
|
#endif //QT_NO_IM
|
||||||
|
Loading…
Reference in New Issue
Block a user