diff options
author | axis <qt-info@nokia.com> | 2009-05-05 07:05:04 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-05-05 07:05:04 (GMT) |
commit | 8731f4ca737d032ffdf12fa9f2dfb2fa550931dd (patch) | |
tree | ce1687a2ebc868251ddeda6865b60a0b3c29b7d5 /src | |
parent | 41f5a37bed62619a67259f2dfe37e3c57e2bf9f7 (diff) | |
download | Qt-8731f4ca737d032ffdf12fa9f2dfb2fa550931dd.zip Qt-8731f4ca737d032ffdf12fa9f2dfb2fa550931dd.tar.gz Qt-8731f4ca737d032ffdf12fa9f2dfb2fa550931dd.tar.bz2 |
Small optimization to input context update.
Only update the input context if it has already been created.
RevBy: denis
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index cfe02d6..d8d7be7 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8501,9 +8501,11 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints) { Q_D(QWidget); d->imHints = hints; - if (testAttribute(Qt::WA_InputMethodEnabled)) { - Q_ASSERT(inputContext()); - inputContext()->update(); + // Optimisation to update input context only it has already been created. + if (d->ic || qApp->d_func()->inputContext) { + QInputContext *ic = inputContext(); + if (ic) + ic->update(); } } |