From 76ca6642a9ddb5ffe21691918a4a803760f0f487 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 6 Oct 2011 17:04:07 +0300 Subject: Removed obsolete custom input context support Removed from QWidgetPrivate and QWidgetTextControl. Now using only application specific input context. Change-Id: Id25882e72026f58dab51a18e5d04a11225429963 Reviewed-on: http://codereview.qt-project.org/6427 Sanity-Review: Qt Sanity Bot Reviewed-by: Joona Petrell Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidget.cpp | 11 +---------- src/widgets/kernel/qwidget_p.h | 3 --- src/widgets/widgets/qwidgettextcontrol.cpp | 14 +++----------- src/widgets/widgets/qwidgettextcontrol_p_p.h | 3 --- 4 files changed, 4 insertions(+), 27 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 7f19f2b22c..3012eab777 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -372,15 +372,6 @@ void QWidgetPrivate::updateWidgetTransform() } } -QInputContext *QWidgetPrivate::inputContext() const -{ -#ifndef QT_NO_IM - return qApp->inputContext(); -#else - return 0; -#endif -} - /*! This function returns the QInputContext for this widget. By default the input context is inherited from the widgets @@ -397,7 +388,7 @@ QInputContext *QWidget::inputContext() if (!testAttribute(Qt::WA_InputMethodEnabled)) return 0; - return d->inputContext(); + return qApp->inputContext(); } #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 102f61feea..01891c74c7 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -83,7 +83,6 @@ #endif #if defined(Q_WS_QWS) -#include "QtWidgets/qinputcontext.h" #include "QtGui/qscreen_qws.h" #endif @@ -569,7 +568,6 @@ public: // sub-classes that their internals are about to be released. virtual void aboutToDestroy() {} - QInputContext *inputContext() const; inline QWidget *effectiveFocusWidget() { QWidget *w = q_func(); while (w->focusProxy()) @@ -699,7 +697,6 @@ public: static QWidgetMapper *mapper; static QWidgetSet *allWidgets; #if !defined(QT_NO_IM) - QPointer ic; Qt::InputMethodHints imHints; #endif #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index e1be88f81b..346499c26f 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1658,7 +1658,7 @@ void QWidgetTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button _q_updateCurrentCharFormatAndSelection(); #ifndef QT_NO_IM if (contextWidget) { - if (QInputContext *ic = inputContext()) { + if (QInputContext *ic = qApp->inputContext()) { ic->update(); } } @@ -1789,7 +1789,7 @@ bool QWidgetTextControlPrivate::sendMouseEventToInputContext( QTextLayout *layout = cursor.block().layout(); if (contextWidget && layout && !layout->preeditAreaText().isEmpty()) { - QInputContext *ctx = inputContext(); + QInputContext *ctx = qApp->inputContext(); int cursorPos = q->hitTest(pos, Qt::FuzzyHit) - cursor.position(); if (cursorPos < 0 || cursorPos > layout->preeditAreaText().length()) { @@ -2140,7 +2140,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget #if !defined(QT_NO_IM) if (d->contextWidget) { - QInputContext *qic = d->inputContext(); + QInputContext *qic = qApp->inputContext(); if (qic) { QList imActions = qic->actions(); for (int i = 0; i < imActions.size(); ++i) @@ -3028,14 +3028,6 @@ void QWidgetTextControlPrivate::_q_copyLink() #endif } -QInputContext *QWidgetTextControlPrivate::inputContext() -{ - QInputContext *ctx = contextWidget->inputContext(); - if (!ctx && contextWidget->parentWidget()) - ctx = contextWidget->parentWidget()->inputContext(); - return ctx; -} - int QWidgetTextControl::hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const { Q_D(const QWidgetTextControl); diff --git a/src/widgets/widgets/qwidgettextcontrol_p_p.h b/src/widgets/widgets/qwidgettextcontrol_p_p.h index 7cc3026dec..8943bb70cf 100644 --- a/src/widgets/widgets/qwidgettextcontrol_p_p.h +++ b/src/widgets/widgets/qwidgettextcontrol_p_p.h @@ -67,7 +67,6 @@ QT_BEGIN_NAMESPACE class QMimeData; class QAbstractScrollArea; -class QInputContext; class QWidgetTextControlPrivate : public QObjectPrivate { @@ -172,8 +171,6 @@ public: void append(const QString &text, Qt::TextFormat format = Qt::AutoText); - QInputContext *inputContext(); - QTextDocument *doc; bool cursorOn; QTextCursor cursor; -- cgit v1.2.3