From 8731f4ca737d032ffdf12fa9f2dfb2fa550931dd Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 5 May 2009 09:05:04 +0200 Subject: Small optimization to input context update. Only update the input context if it has already been created. RevBy: denis --- src/gui/kernel/qwidget.cpp | 8 +++++--- 1 file 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(); } } -- cgit v0.12