diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2011-09-23 15:28:19 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-28 14:02:08 +0200 |
commit | 3d71266fea91628d28ae4e55cd105a0bd5d8b457 (patch) | |
tree | 97dd3a62e57ca0e605571aab90d49fb4ca4418a3 /src/widgets/kernel/qwidget.cpp | |
parent | d0968472c6fc3a9648caa864db39c67db57cef0d (diff) |
Remove support for QWidget specific input contexts
QInputContext is migrated to QInputPanel, which allows only one
instance.
Change-Id: I4912164790d5a6bdff41e11cbe4bc4e2f9f111ec
Reviewed-on: http://codereview.qt-project.org/5641
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 4cb01b9e72..f8d5e68da7 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -372,24 +372,9 @@ void QWidgetPrivate::updateWidgetTransform() } } -QInputContext *QWidgetPrivate::assignedInputContext() const -{ -#ifndef QT_NO_IM - const QWidget *widget = q_func(); - while (widget) { - if (QInputContext *qic = widget->d_func()->ic) - return qic; - widget = widget->parentWidget(); - } -#endif - return 0; -} - QInputContext *QWidgetPrivate::inputContext() const { #ifndef QT_NO_IM - if (QInputContext *qic = assignedInputContext()) - return qic; return qApp->inputContext(); #else return 0; @@ -415,31 +400,6 @@ QInputContext *QWidget::inputContext() return d->inputContext(); } -/*! - This function sets the input context \a context - on this widget. - - Qt takes ownership of the given input \a context. - - \sa inputContext() -*/ -void QWidget::setInputContext(QInputContext *context) -{ - Q_D(QWidget); - if (!testAttribute(Qt::WA_InputMethodEnabled)) - return; -#ifndef QT_NO_IM - if (context == d->ic) - return; - if (d->ic) - delete d->ic; - d->ic = context; - if (d->ic) - d->ic->setParent(this); -#endif -} - - #ifdef QT_KEYPAD_NAVIGATION QPointer<QWidget> QWidgetPrivate::editingWidget; @@ -10415,9 +10375,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) case Qt::WA_InputMethodEnabled: { #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); - QInputContext *ic = focusWidget->d_func()->assignedInputContext(); - if (!ic && (!on || hasFocus())) - ic = focusWidget->d_func()->inputContext(); + QInputContext *ic = qApp->inputContext(); if (ic) { if (on && hasFocus() && ic->focusWidget() != focusWidget && isEnabled() && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { |