summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/kernel.pri4
-rw-r--r--src/gui/kernel/qguiapplication.cpp17
-rw-r--r--src/gui/kernel/qguiapplication.h5
-rw-r--r--src/gui/kernel/qguiapplication_p.h2
-rw-r--r--src/gui/kernel/qinputmethod.cpp (renamed from src/gui/kernel/qinputpanel.cpp)112
-rw-r--r--src/gui/kernel/qinputmethod.h134
-rw-r--r--src/gui/kernel/qinputmethod_p.h83
-rw-r--r--src/gui/kernel/qinputpanel.h83
-rw-r--r--src/gui/kernel/qinputpanel_p.h33
-rw-r--r--src/gui/kernel/qplatforminputcontext_qpa.cpp28
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp18
-rw-r--r--src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp40
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp22
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp10
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp4
-rw-r--r--src/widgets/kernel/qapplication.cpp16
-rw-r--r--src/widgets/kernel/qinputcontext.cpp12
-rw-r--r--src/widgets/kernel/qwidget.cpp24
-rw-r--r--src/widgets/kernel/qwidget_p.h6
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qlineedit.cpp6
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp10
-rw-r--r--src/widgets/widgets/qlineedit_p.h2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h6
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp8
27 files changed, 411 insertions, 282 deletions
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index bc0cb4e974..7b01ba14cd 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -38,6 +38,8 @@ HEADERS += \
kernel/qdnd_p.h \
kernel/qevent.h \
kernel/qevent_p.h \
+ kernel/qinputmethod.h \
+ kernel/qinputmethod_p.h \
kernel/qinputpanel.h \
kernel/qinputpanel_p.h \
kernel/qkeysequence.h \
@@ -84,7 +86,7 @@ SOURCES += \
kernel/qdrag.cpp \
kernel/qdnd.cpp \
kernel/qevent.cpp \
- kernel/qinputpanel.cpp \
+ kernel/qinputmethod.cpp \
kernel/qkeysequence.cpp \
kernel/qkeymapper.cpp \
kernel/qkeymapper_qpa.cpp \
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index a97647f504..4096628d93 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -183,7 +183,7 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags)
: QCoreApplicationPrivate(argc, argv, flags),
styleHints(0),
- inputPanel(0)
+ inputMethod(0)
{
self = this;
application_type = QCoreApplication::GuiClient;
@@ -522,7 +522,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
cleanupThreadData();
delete styleHints;
- delete inputPanel;
+ delete inputMethod;
delete platform_integration;
platform_integration = 0;
@@ -1572,12 +1572,17 @@ QStyleHints *QGuiApplication::styleHints() const
\sa QInputPanel
*/
-QInputPanel *QGuiApplication::inputPanel() const
+QInputMethod *QGuiApplication::inputMethod() const
{
Q_D(const QGuiApplication);
- if (!d->inputPanel)
- const_cast<QGuiApplicationPrivate *>(d)->inputPanel = new QInputPanel();
- return d->inputPanel;
+ if (!d->inputMethod)
+ const_cast<QGuiApplicationPrivate *>(d)->inputMethod = new QInputMethod();
+ return d->inputMethod;
+}
+
+QInputPanel *QGuiApplication::inputPanel() const
+{
+ return inputMethod();
}
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index 9bf6a69c45..75046d8767 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -44,6 +44,7 @@
#include <QtCore/qcoreapplication.h>
#include <QtGui/qwindowdefs.h>
+#include <QtGui/qinputpanel.h>
#include <QtCore/qlocale.h>
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
@@ -58,7 +59,6 @@ class QPlatformNativeInterface;
class QPalette;
class QScreen;
class QStyleHints;
-class QInputPanel;
#if defined(qApp)
#undef qApp
@@ -121,7 +121,8 @@ public:
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
QStyleHints *styleHints() const;
- QInputPanel *inputPanel() const;
+ QT_DEPRECATED QInputPanel *inputPanel() const;
+ QInputMethod *inputMethod() const;
static QPlatformNativeInterface *platformNativeInterface();
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 2f1cfa509d..d9444ebe95 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -181,7 +181,7 @@ public:
static QFont *app_font;
QStyleHints *styleHints;
- QInputPanel *inputPanel;
+ QInputMethod *inputMethod;
static QList<QObject *> generic_plugin_list;
#ifndef QT_NO_SHORTCUT
diff --git a/src/gui/kernel/qinputpanel.cpp b/src/gui/kernel/qinputmethod.cpp
index 8b28c680bf..de00396e40 100644
--- a/src/gui/kernel/qinputpanel.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include <qinputpanel.h>
-#include <private/qinputpanel_p.h>
+#include <qinputmethod.h>
+#include <private/qinputmethod_p.h>
#include <qguiapplication.h>
#include <qtimer.h>
@@ -49,8 +49,8 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QInputPanel::QInputPanel()
- : QObject(*new QInputPanelPrivate)
+QInputMethod::QInputMethod()
+ : QObject(*new QInputMethodPrivate)
{
// might be instantiated before QGuiApplication is fully done, need to connect later
QTimer::singleShot(0, this, SLOT(q_connectFocusObject()));
@@ -59,24 +59,24 @@ QInputPanel::QInputPanel()
/*!
\internal
*/
-QInputPanel::~QInputPanel()
+QInputMethod::~QInputMethod()
{
}
/*!
- \class QInputPanel
- \brief The QInputPanel class provides access to the active text input method.
+ \class QInputMethod
+ \brief The QInputMethod class provides access to the active text input method.
- QInputPanel is used by the text editors for integrating to the platform text input
+ QInputMethod is used by the text editors for integrating to the platform text input
methods and more commonly by application views for querying various text input method-related
information like virtual keyboard visibility and keyboard dimensions.
- Qt Quick also provides access to QInputPanel in QML through \l{QmlGlobalQtObject}{Qt global object}
+ Qt Quick also provides access to QInputMethod in QML through \l{QmlGlobalQtObject}{Qt global object}
as \c Qt.application.inputPanel property.
*/
/*!
- \property QInputPanel::inputItem
+ \property QInputMethod::inputItem
\brief Focused item that accepts text input
\obsolete
@@ -87,15 +87,15 @@ QInputPanel::~QInputPanel()
\sa inputItemTransform, inputWindow, QInputMethodQueryEvent, QInputMethodEvent
*/
-QObject *QInputPanel::inputItem() const
+QObject *QInputMethod::inputItem() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
return d->inputItem.data();
}
-void QInputPanel::setInputItem(QObject *inputItem)
+void QInputMethod::setInputItem(QObject *inputItem)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
if (d->inputItem.data() == inputItem)
return;
@@ -109,7 +109,7 @@ void QInputPanel::setInputItem(QObject *inputItem)
\obsolete
*/
-QWindow *QInputPanel::inputWindow() const
+QWindow *QInputMethod::inputWindow() const
{
return qApp->activeWindow();
}
@@ -117,9 +117,9 @@ QWindow *QInputPanel::inputWindow() const
/*!
Returns the transformation from input item coordinates to the window coordinates.
*/
-QTransform QInputPanel::inputItemTransform() const
+QTransform QInputMethod::inputItemTransform() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
return d->inputItemTransform;
}
@@ -128,9 +128,9 @@ QTransform QInputPanel::inputItemTransform() const
Item transform needs to be updated by the focused window like QQuickCanvas whenever
item is moved inside the scene.
*/
-void QInputPanel::setInputItemTransform(const QTransform &transform)
+void QInputMethod::setInputItemTransform(const QTransform &transform)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
if (d->inputItemTransform == transform)
return;
@@ -139,15 +139,15 @@ void QInputPanel::setInputItemTransform(const QTransform &transform)
}
/*!
- \property QInputPanel::cursorRectangle
+ \property QInputMethod::cursorRectangle
\brief Input item's cursor rectangle in window coordinates.
Cursor rectangle is often used by various text editing controls
like text prediction popups for following the text being typed.
*/
-QRectF QInputPanel::cursorRectangle() const
+QRectF QInputMethod::cursorRectangle() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
if (!d->inputItem)
return QRectF();
@@ -162,12 +162,12 @@ QRectF QInputPanel::cursorRectangle() const
}
/*!
- \property QInputPanel::keyboardRectangle
+ \property QInputMethod::keyboardRectangle
\brief Virtual keyboard's geometry in window coordinates.
*/
-QRectF QInputPanel::keyboardRectangle() const
+QRectF QInputMethod::keyboardRectangle() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->keyboardRect();
@@ -183,9 +183,9 @@ QRectF QInputPanel::keyboardRectangle() const
function, keyboard should automatically open when
the text editor gains focus.
*/
-void QInputPanel::show()
+void QInputMethod::show()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->showInputPanel();
@@ -198,26 +198,26 @@ void QInputPanel::show()
keyboard should automatically close when the text editor loses
focus, for example when the parent view is closed.
*/
-void QInputPanel::hide()
+void QInputMethod::hide()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->hideInputPanel();
}
/*!
- \property QInputPanel::visible
+ \property QInputMethod::visible
\brief Virtual keyboard's visibility on the screen
- Input panel visibility remains false for devices
+ Input method visibility remains false for devices
with no virtual keyboards.
\sa show(), hide()
*/
-bool QInputPanel::visible() const
+bool QInputMethod::visible() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->isInputPanelVisible();
@@ -230,13 +230,13 @@ bool QInputPanel::visible() const
\sa show(), hide()
*/
-void QInputPanel::setVisible(bool visible)
+void QInputMethod::setVisible(bool visible)
{
visible ? show() : hide();
}
/*!
- \property QInputPanel::animating
+ \property QInputMethod::animating
\brief True when the virtual keyboard is being opened or closed.
Animating is false when keyboard is fully open or closed.
@@ -245,9 +245,9 @@ void QInputPanel::setVisible(bool visible)
false keyboard is being closed.
*/
-bool QInputPanel::isAnimating() const
+bool QInputMethod::isAnimating() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->isAnimating();
@@ -255,12 +255,12 @@ bool QInputPanel::isAnimating() const
}
/*!
- \property QInputPanel::locale
+ \property QInputMethod::locale
\brief Current input locale.
*/
-QLocale QInputPanel::locale() const
+QLocale QInputMethod::locale() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->locale();
@@ -268,12 +268,12 @@ QLocale QInputPanel::locale() const
}
/*!
- \property QInputPanel::inputDirection
+ \property QInputMethod::inputDirection
\brief Current input direction.
*/
-Qt::LayoutDirection QInputPanel::inputDirection() const
+Qt::LayoutDirection QInputMethod::inputDirection() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->inputDirection();
@@ -291,9 +291,9 @@ Qt::LayoutDirection QInputPanel::inputDirection() const
to change as well. The attributes that often change together with cursor position
have been grouped in Qt::ImQueryInput value for convenience.
*/
-void QInputPanel::update(Qt::InputMethodQueries queries)
+void QInputMethod::update(Qt::InputMethodQueries queries)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
if (queries & Qt::ImEnabled)
d->q_checkFocusObject(qApp->focusObject());
@@ -312,9 +312,9 @@ void QInputPanel::update(Qt::InputMethodQueries queries)
Input method resets automatically when the focused editor changes.
*/
-void QInputPanel::reset()
+void QInputMethod::reset()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->reset();
@@ -328,9 +328,9 @@ void QInputPanel::reset()
interrupts the text composing needs to flush the composing state by calling the
commit() function, for example when the cursor is moved elsewhere.
*/
-void QInputPanel::commit()
+void QInputMethod::commit()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->commit();
@@ -341,26 +341,26 @@ void QInputPanel::commit()
the user. Input methods often use this information to offer more word
suggestions to the user.
*/
-void QInputPanel::invokeAction(Action a, int cursorPosition)
+void QInputMethod::invokeAction(Action a, int cursorPosition)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->invokeAction(a, cursorPosition);
}
// temporary handlers for updating focus item based on application focus
-void QInputPanelPrivate::q_connectFocusObject()
+void QInputMethodPrivate::q_connectFocusObject()
{
- Q_Q(QInputPanel);
+ Q_Q(QInputMethod);
QObject::connect(qApp, SIGNAL(focusObjectChanged(QObject*)),
q, SLOT(q_checkFocusObject(QObject*)));
q_checkFocusObject(qApp->focusObject());
}
-void QInputPanelPrivate::q_checkFocusObject(QObject *object)
+void QInputMethodPrivate::q_checkFocusObject(QObject *object)
{
- Q_Q(QInputPanel);
+ Q_Q(QInputMethod);
bool enabled = false;
if (object) {
@@ -373,4 +373,4 @@ void QInputPanelPrivate::q_checkFocusObject(QObject *object)
QT_END_NAMESPACE
-#include "moc_qinputpanel.cpp"
+#include "moc_qinputmethod.cpp"
diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h
new file mode 100644
index 0000000000..535ed1608d
--- /dev/null
+++ b/src/gui/kernel/qinputmethod.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QINPUTMETHOD_H
+#define QINPUTMETHOD_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QInputMethodPrivate;
+class QWindow;
+class QRectF;
+class QTransform;
+
+class Q_GUI_EXPORT QInputMethod : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QInputMethod)
+ Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
+ Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
+ Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
+ Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
+ Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
+ Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
+ Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
+
+ Q_ENUMS(Action)
+public:
+ QT_DEPRECATED QObject *inputItem() const;
+ QT_DEPRECATED void setInputItem(QObject *inputItemChanged);
+
+ // the window containing the editor
+ QT_DEPRECATED QWindow *inputWindow() const;
+
+ QTransform inputItemTransform() const;
+ void setInputItemTransform(const QTransform &transform);
+
+ // in window coordinates
+ QRectF cursorRectangle() const; // ### what if we have rotations for the item?
+
+ // keyboard geometry in window coords
+ QRectF keyboardRectangle() const;
+
+ enum Action {
+ Click,
+ ContextMenu
+ };
+
+ bool visible() const;
+ void setVisible(bool visible);
+
+ bool isAnimating() const;
+
+ QLocale locale() const;
+ Qt::LayoutDirection inputDirection() const;
+
+public Q_SLOTS:
+ void show();
+ void hide();
+
+ void update(Qt::InputMethodQueries queries);
+ void reset();
+ void commit();
+
+ void invokeAction(Action a, int cursorPosition);
+
+Q_SIGNALS:
+ void inputItemChanged();
+ void cursorRectangleChanged();
+ void keyboardRectangleChanged();
+ void visibleChanged();
+ void animatingChanged();
+ void localeChanged();
+ void inputDirectionChanged(Qt::LayoutDirection newDirection);
+
+private:
+ friend class QGuiApplication;
+ friend class QGuiApplicationPrivate;
+ friend class QPlatformInputContext;
+ QInputMethod();
+ ~QInputMethod();
+
+ Q_PRIVATE_SLOT(d_func(), void q_connectFocusObject());
+ Q_PRIVATE_SLOT(d_func(), void q_checkFocusObject(QObject* object));
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif
diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h
new file mode 100644
index 0000000000..862764d1bc
--- /dev/null
+++ b/src/gui/kernel/qinputmethod_p.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QINPUTMETHOD_P_H
+#define QINPUTMETHOD_P_H
+
+#include <qinputmethod.h>
+#include <private/qobject_p.h>
+#include <QtCore/QWeakPointer>
+#include <QTransform>
+#include <qplatforminputcontext_qpa.h>
+#include <private/qguiapplication_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QInputMethodPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QInputMethod)
+
+public:
+ inline QInputMethodPrivate() : testContext(0)
+ {}
+ QPlatformInputContext *platformInputContext() const
+ {
+ return testContext ? testContext : QGuiApplicationPrivate::platformIntegration()->inputContext();
+ }
+ static inline QInputMethodPrivate *get(QInputMethod *inputMethod)
+ {
+ return inputMethod->d_func();
+ }
+ void q_connectFocusObject();
+ void q_checkFocusObject(QObject *object);
+
+ QTransform inputItemTransform;
+ QWeakPointer<QObject> inputItem;
+ QPlatformInputContext *testContext;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif
diff --git a/src/gui/kernel/qinputpanel.h b/src/gui/kernel/qinputpanel.h
index 7b16709e42..95be71d7b5 100644
--- a/src/gui/kernel/qinputpanel.h
+++ b/src/gui/kernel/qinputpanel.h
@@ -42,89 +42,16 @@
#ifndef QINPUTPANEL_H
#define QINPUTPANEL_H
-#include <QtCore/qobject.h>
+#include <QtGui/qinputmethod.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-class QInputPanelPrivate;
-class QWindow;
-class QRectF;
-class QTransform;
-
-class Q_GUI_EXPORT QInputPanel : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QInputPanel)
- Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
- Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
- Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
- Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
- Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
- Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
- Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
-
- Q_ENUMS(Action)
-public:
- QT_DEPRECATED QObject *inputItem() const;
- QT_DEPRECATED void setInputItem(QObject *inputItemChanged);
-
- // the window containing the editor
- QT_DEPRECATED QWindow *inputWindow() const;
-
- QTransform inputItemTransform() const;
- void setInputItemTransform(const QTransform &transform);
-
- // in window coordinates
- QRectF cursorRectangle() const; // ### what if we have rotations for the item?
-
- // keyboard geometry in window coords
- QRectF keyboardRectangle() const;
-
- enum Action {
- Click,
- ContextMenu
- };
-
- bool visible() const;
- void setVisible(bool visible);
-
- bool isAnimating() const;
-
- QLocale locale() const;
- Qt::LayoutDirection inputDirection() const;
-
-public Q_SLOTS:
- void show();
- void hide();
-
- void update(Qt::InputMethodQueries queries);
- void reset();
- void commit();
-
- void invokeAction(Action a, int cursorPosition);
-
-Q_SIGNALS:
- void inputItemChanged();
- void cursorRectangleChanged();
- void keyboardRectangleChanged();
- void visibleChanged();
- void animatingChanged();
- void localeChanged();
- void inputDirectionChanged(Qt::LayoutDirection newDirection);
-
-private:
- friend class QGuiApplication;
- friend class QGuiApplicationPrivate;
- friend class QPlatformInputContext;
- QInputPanel();
- ~QInputPanel();
-
- Q_PRIVATE_SLOT(d_func(), void q_connectFocusObject());
- Q_PRIVATE_SLOT(d_func(), void q_checkFocusObject(QObject* object));
-};
+#if 0
+#pragma qt_class(QInputPanel)
+#endif
+#define QInputPanel QInputMethod
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qinputpanel_p.h b/src/gui/kernel/qinputpanel_p.h
index 88916f80a4..a4f24505c6 100644
--- a/src/gui/kernel/qinputpanel_p.h
+++ b/src/gui/kernel/qinputpanel_p.h
@@ -42,39 +42,16 @@
#ifndef QINPUTPANEL_P_H
#define QINPUTPANEL_P_H
-#include <qinputpanel.h>
-#include <private/qobject_p.h>
-#include <QtCore/QWeakPointer>
-#include <QTransform>
-#include <qplatforminputcontext_qpa.h>
-#include <private/qguiapplication_p.h>
+#include <private/qinputmethod_p.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QInputPanelPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QInputPanel)
-
-public:
- inline QInputPanelPrivate() : testContext(0)
- {}
- QPlatformInputContext *platformInputContext() const
- {
- return testContext ? testContext : QGuiApplicationPrivate::platformIntegration()->inputContext();
- }
- static inline QInputPanelPrivate *get(QInputPanel *inputPanel)
- {
- return inputPanel->d_func();
- }
- void q_connectFocusObject();
- void q_checkFocusObject(QObject *object);
-
- QTransform inputItemTransform;
- QWeakPointer<QObject> inputItem;
- QPlatformInputContext *testContext;
-};
+#if 0
+#pragma qt_class(QInputPanelPrivate)
+#endif
+#define QInputPanelPrivate QInputMethodPrivate
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp
index f36a4a1af5..ee18f3ebd1 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa.cpp
+++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
QPlatformInputContext provides an interface the actual input methods
can derive from by reimplementing methods.
- \sa QInputPanel
+ \sa QInputMethod
*/
/*!
@@ -94,7 +94,7 @@ bool QPlatformInputContext::isValid() const
}
/*!
- Method to be called when input method needs to be reset. Called by QInputPanel::reset().
+ Method to be called when input method needs to be reset. Called by QInputMethod::reset().
No further QInputMethodEvents should be sent as response.
*/
void QPlatformInputContext::reset()
@@ -106,7 +106,7 @@ void QPlatformInputContext::commit()
}
/*!
- Notification on editor updates. Called by QInputPanel::update().
+ Notification on editor updates. Called by QInputMethod::update().
*/
void QPlatformInputContext::update(Qt::InputMethodQueries)
{
@@ -117,12 +117,12 @@ void QPlatformInputContext::update(Qt::InputMethodQueries)
the user. Input methods often use this information to offer more word
suggestions to the user.
*/
-void QPlatformInputContext::invokeAction(QInputPanel::Action action, int cursorPosition)
+void QPlatformInputContext::invokeAction(QInputMethod::Action action, int cursorPosition)
{
Q_UNUSED(cursorPosition)
// Default behavior for simple ephemeral input contexts. Some
// complex input contexts should not be reset here.
- if (action == QInputPanel::Click)
+ if (action == QInputMethod::Click)
reset();
}
@@ -148,17 +148,17 @@ QRectF QPlatformInputContext::keyboardRect() const
}
/*!
- Active QPlatformInputContext is responsible for providing keyboardRectangle property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing keyboardRectangle property to QInputMethod.
In addition of providing the value in keyboardRect function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitKeyboardRectChanged()
{
- emit qApp->inputPanel()->keyboardRectangleChanged();
+ emit qApp->inputMethod()->keyboardRectangleChanged();
}
/*!
- This function can be reimplemented to return true whenever input panel is animating
+ This function can be reimplemented to return true whenever input method is animating
shown or hidden. Default implementation returns false.
*/
bool QPlatformInputContext::isAnimating() const
@@ -167,13 +167,13 @@ bool QPlatformInputContext::isAnimating() const
}
/*!
- Active QPlatformInputContext is responsible for providing animating property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing animating property to QInputMethod.
In addition of providing the value in isAnimation function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitAnimatingChanged()
{
- emit qApp->inputPanel()->animatingChanged();
+ emit qApp->inputMethod()->animatingChanged();
}
/*!
@@ -199,13 +199,13 @@ bool QPlatformInputContext::isInputPanelVisible() const
}
/*!
- Active QPlatformInputContext is responsible for providing visible property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing visible property to QInputMethod.
In addition of providing the value in isInputPanelVisible function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitInputPanelVisibleChanged()
{
- emit qApp->inputPanel()->visibleChanged();
+ emit qApp->inputMethod()->visibleChanged();
}
QLocale QPlatformInputContext::locale() const
@@ -215,7 +215,7 @@ QLocale QPlatformInputContext::locale() const
void QPlatformInputContext::emitLocaleChanged()
{
- emit qApp->inputPanel()->localeChanged();
+ emit qApp->inputMethod()->localeChanged();
}
Qt::LayoutDirection QPlatformInputContext::inputDirection() const
@@ -225,7 +225,7 @@ Qt::LayoutDirection QPlatformInputContext::inputDirection() const
void QPlatformInputContext::emitInputDirectionChanged(Qt::LayoutDirection newDirection)
{
- emit qApp->inputPanel()->inputDirectionChanged(newDirection);
+ emit qApp->inputMethod()->inputDirectionChanged(newDirection);
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 3f4968f967..5e5354a980 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -54,7 +54,7 @@
#include <private/qunicodetables_p.h>
#include "qtextdocument_p.h"
#include <qguiapplication.h>
-#include <qinputpanel.h>
+#include <qinputmethod.h>
#include <stdlib.h>
@@ -1409,7 +1409,7 @@ bool QTextEngine::isRightToLeft() const
itemize();
// this places the cursor in the right position depending on the keyboard layout
if (layoutData->string.isEmpty())
- return qApp ? qApp->inputPanel()->inputDirection() == Qt::RightToLeft : false;
+ return qApp ? qApp->inputMethod()->inputDirection() == Qt::RightToLeft : false;
return layoutData->string.isRightToLeft();
}
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 4a18ae62bd..5840415ded 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -88,7 +88,7 @@ QIBusPlatformInputContext::QIBusPlatformInputContext ()
connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
}
- QInputPanel *p = qApp->inputPanel();
+ QInputMethod *p = qApp->inputMethod();
connect(p, SIGNAL(inputItemChanged()), this, SLOT(inputItemChanged()));
connect(p, SIGNAL(cursorRectangleChanged()), this, SLOT(cursorRectChanged()));
}
@@ -103,12 +103,12 @@ bool QIBusPlatformInputContext::isValid() const
return d->valid;
}
-void QIBusPlatformInputContext::invokeAction(QInputPanel::Action a, int x)
+void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int x)
{
if (!d->valid)
return;
- if (a == QInputPanel::Click)
+ if (a == QInputMethod::Click)
commit();
}
@@ -130,7 +130,7 @@ void QIBusPlatformInputContext::commit()
if (!d->valid)
return;
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input) {
d->predit = QString();
return;
@@ -155,11 +155,11 @@ void QIBusPlatformInputContext::cursorRectChanged()
if (!d->valid)
return;
- QRect r = qApp->inputPanel()->cursorRectangle().toRect();
+ QRect r = qApp->inputMethod()->cursorRectangle().toRect();
if(!r.isValid())
return;
- QWindow *inputWindow = qApp->inputPanel()->inputWindow();
+ QWindow *inputWindow = qApp->inputMethod()->inputWindow();
if (!inputWindow)
return;
r.moveTopLeft(inputWindow->mapToGlobal(r.topLeft()));
@@ -173,7 +173,7 @@ void QIBusPlatformInputContext::inputItemChanged()
if (!d->valid)
return;
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (debug)
qDebug() << "setFocusObject" << input;
if (input)
@@ -184,7 +184,7 @@ void QIBusPlatformInputContext::inputItemChanged()
void QIBusPlatformInputContext::commitText(const QDBusVariant &text)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
@@ -206,7 +206,7 @@ void QIBusPlatformInputContext::commitText(const QDBusVariant &text)
void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint cursorPos, bool visible)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
diff --git a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp
index 724f50db8f..bd3b914f15 100644
--- a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp
@@ -182,8 +182,8 @@ QMaliitPlatformInputContext::QMaliitPlatformInputContext()
{
if (debug)
qDebug() << "QMaliitPlatformInputContext::QMaliitPlatformInputContext()";
- QInputPanel *p = qApp->inputPanel();
- connect(p, SIGNAL(inputItemChanged()), this, SLOT(inputItemChanged()));
+ QInputMethod *im = qApp->inputMethod();
+ connect(im, SIGNAL(inputItemChanged()), this, SLOT(inputItemChanged()));
}
QMaliitPlatformInputContext::~QMaliitPlatformInputContext(void)
@@ -196,13 +196,13 @@ bool QMaliitPlatformInputContext::isValid() const
return d->valid;
}
-void QMaliitPlatformInputContext::invokeAction(QInputPanel::Action action, int x)
+void QMaliitPlatformInputContext::invokeAction(QInputMethod::Action action, int x)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
- if (action == QInputPanel::Click) {
+ if (action == QInputMethod::Click) {
if (x < 0 || x >= d->preedit.length()) {
reset();
return;
@@ -220,7 +220,7 @@ void QMaliitPlatformInputContext::invokeAction(QInputPanel::Action action, int x
void QMaliitPlatformInputContext::reset()
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
const bool hadPreedit = !d->preedit.isEmpty();
if (hadPreedit && input) {
@@ -238,8 +238,8 @@ void QMaliitPlatformInputContext::reset()
void QMaliitPlatformInputContext::update(Qt::InputMethodQueries queries)
{
- QInputPanel *panel = qApp->inputPanel();
- QObject *input = panel->inputItem();
+ QInputMethod *method = qApp->inputMethod();
+ QObject *input = method->inputItem();
if (!input)
return;
@@ -254,8 +254,8 @@ void QMaliitPlatformInputContext::update(Qt::InputMethodQueries queries)
d->imState["anchorPosition"] = query.value(Qt::ImAnchorPosition);
if (queries & Qt::ImCursorRectangle) {
QRect rect = query.value(Qt::ImCursorRectangle).toRect();
- rect = panel->inputItemTransform().mapRect(rect);
- QWindow *window = panel->inputWindow();
+ rect = method->inputItemTransform().mapRect(rect);
+ QWindow *window = method->inputWindow();
if (window)
d->imState["cursorRectangle"] = QRect(window->mapToGlobal(rect.topLeft()), rect.size());
}
@@ -289,7 +289,7 @@ void QMaliitPlatformInputContext::activationLostEvent()
void QMaliitPlatformInputContext::commitString(const QString &string, int replacementStart, int replacementLength, int cursorPos)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
@@ -305,7 +305,7 @@ void QMaliitPlatformInputContext::commitString(const QString &string, int replac
void QMaliitPlatformInputContext::updatePreedit(const QDBusMessage &message)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
@@ -421,7 +421,7 @@ void QMaliitPlatformInputContext::paste()
bool QMaliitPlatformInputContext::preeditRectangle(int &x, int &y, int &width, int &height)
{
// ###
- QRect r = qApp->inputPanel()->cursorRectangle().toRect();
+ QRect r = qApp->inputMethod()->cursorRectangle().toRect();
if (!r.isValid())
return false;
x = r.x();
@@ -435,7 +435,7 @@ bool QMaliitPlatformInputContext::selection(QString &selection)
{
selection.clear();
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return false;
@@ -471,7 +471,7 @@ void QMaliitPlatformInputContext::setRedirectKeys(bool)
void QMaliitPlatformInputContext::setSelection(int start, int length)
{
- QObject *input = qApp->inputPanel()->inputItem();
+ QObject *input = qApp->inputMethod()->inputItem();
if (!input)
return;
@@ -497,9 +497,9 @@ void QMaliitPlatformInputContext::inputItemChanged()
if (!d->valid)
return;
- QInputPanel *panel = qApp->inputPanel();
- QObject *input = panel->inputItem();
- QWindow *window = panel->inputWindow();
+ QInputMethod *method = qApp->inputMethod();
+ QObject *input = method->inputItem();
+ QWindow *window = method->inputWindow();
if (window != d->window.data()) {
if (d->window)
disconnect(d->window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
@@ -533,8 +533,8 @@ void QMaliitPlatformInputContext::showInputPanel()
if (debug)
qDebug() << "showInputPanel";
- QInputPanel *panel = qApp->inputPanel();
- if (!panel->inputItem() || !panel->inputWindow())
+ QInputMethod *method = qApp->inputMethod();
+ if (!method->inputItem() || !method->inputWindow())
d->visibility = InputPanelShowRequested;
else {
d->server->showInputMethod();
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 2acde9af84..5085dfefb7 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -167,7 +167,7 @@ QWindowsInputContext::QWindowsInputContext() :
m_WM_MSIME_MOUSE(RegisterWindowMessage(L"MSIMEMouseOperation")),
m_endCompositionRecursionGuard(false)
{
- connect(qApp->inputPanel(), SIGNAL(cursorRectangleChanged()),
+ connect(qApp->inputMethod(), SIGNAL(cursorRectangleChanged()),
this, SLOT(cursorRectChanged()));
}
@@ -184,7 +184,7 @@ void QWindowsInputContext::reset()
QPlatformInputContext::reset();
if (!m_compositionContext.hwnd)
return;
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (QWindowsContext::verboseInputMethods)
qDebug() << __FUNCTION__<< fo;
if (!fo)
@@ -213,8 +213,8 @@ void QWindowsInputContext::cursorRectChanged()
{
if (!m_compositionContext.hwnd)
return;
- const QInputPanel *inputPanel = qApp->inputPanel();
- QRect cursorRectangle = inputPanel->cursorRectangle().toRect();
+ const QInputMethod *inputMethod = qApp->inputMethod();
+ QRect cursorRectangle = inputMethod->cursorRectangle().toRect();
if (!cursorRectangle.isValid())
return;
@@ -249,9 +249,9 @@ void QWindowsInputContext::cursorRectChanged()
ImmReleaseContext(m_compositionContext.hwnd, himc);
}
-void QWindowsInputContext::invokeAction(QInputPanel::Action action, int cursorPosition)
+void QWindowsInputContext::invokeAction(QInputMethod::Action action, int cursorPosition)
{
- if (action != QInputPanel::Click || !m_compositionContext.hwnd) {
+ if (action != QInputMethod::Click || !m_compositionContext.hwnd) {
QPlatformInputContext::invokeAction(action, cursorPosition);
return;
}
@@ -329,11 +329,11 @@ static inline QTextFormat standardFormat(StandardFormat format)
bool QWindowsInputContext::startComposition(HWND hwnd)
{
- const QObject *fo = qApp->inputPanel()->inputItem();
+ const QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
// This should always match the object.
- QWindow *window = qApp->inputPanel()->inputWindow();
+ QWindow *window = qApp->inputMethod()->inputWindow();
if (!window)
return false;
if (QWindowsContext::verboseInputMethods)
@@ -397,7 +397,7 @@ static inline QList<QInputMethodEvent::Attribute>
bool QWindowsInputContext::composition(HWND hwnd, LPARAM lParamIn)
{
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
const int lParam = int(lParamIn);
if (QWindowsContext::verboseInputMethods)
qDebug() << '>' << __FUNCTION__ << fo << debugComposition(lParam)
@@ -459,7 +459,7 @@ bool QWindowsInputContext::endComposition(HWND hwnd)
// against that.
if (m_endCompositionRecursionGuard || m_compositionContext.hwnd != hwnd)
return false;
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
@@ -537,7 +537,7 @@ bool QWindowsInputContext::handleIME_Request(WPARAM wParam,
int QWindowsInputContext::reconvertString(RECONVERTSTRING *reconv)
{
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 8dbcd9f81e..7fc7c3db02 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -743,7 +743,7 @@
#include <QtGui/qpixmapcache.h>
#include <QtWidgets/qstyleoption.h>
#include <QtGui/qevent.h>
-#include <QtGui/qinputpanel.h>
+#include <QtGui/qinputmethod.h>
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
@@ -7379,7 +7379,7 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
QWidget *fw = QApplication::focusWidget();
if (!fw)
return;
- qApp->inputPanel()->update(Qt::ImHints);
+ qApp->inputMethod()->update(Qt::ImHints);
}
/*!
@@ -7397,7 +7397,7 @@ void QGraphicsItem::updateMicroFocus()
for (int i = 0 ; i < scene()->views().count() ; ++i) {
if (scene()->views().at(i) == fw) {
if (qApp)
- qApp->inputPanel()->update(Qt::ImQueryAll);
+ qApp->inputMethod()->update(Qt::ImQueryAll);
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
@@ -10215,9 +10215,9 @@ bool QGraphicsTextItem::sceneEvent(QEvent *event)
// Reset the focus widget's input context, regardless
// of how this item gained or lost focus.
if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) {
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
} else {
- qApp->inputPanel()->update(Qt::ImQueryInput);
+ qApp->inputMethod()->update(Qt::ImQueryInput);
}
break;
case QEvent::ShortcutOverride:
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index ce94f80a14..280aa7af8e 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -243,7 +243,7 @@
#include <QtWidgets/qstyleoption.h>
#include <QtWidgets/qtooltip.h>
#include <QtGui/qtransform.h>
-#include <QtGui/qinputpanel.h>
+#include <QtGui/qinputmethod.h>
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include <QtGui/qaccessible.h>
@@ -822,7 +822,7 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
// the views, but if we are changing focus, we have to
// do it ourselves.
if (qApp)
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
}
focusItem = 0;
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index cb6a8c1e7c..c23622ac78 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -69,7 +69,7 @@
#include "qmessagebox.h"
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
-#include <QtGui/qinputpanel.h>
+#include <QtGui/qinputmethod.h>
#include "qinputcontext.h"
#include "private/qkeymapper_p.h"
@@ -1976,7 +1976,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
// or it is not created fully yet.
|| (focus_widget && (!focus_widget->testAttribute(Qt::WA_InputMethodEnabled)
|| !focus_widget->testAttribute(Qt::WA_WState_Created))))) {
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
}
#endif //QT_NO_IM
@@ -3873,10 +3873,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
}
case QEvent::RequestSoftwareInputPanel:
- inputPanel()->show();
+ inputMethod()->show();
break;
case QEvent::CloseSoftwareInputPanel:
- inputPanel()->hide();
+ inputMethod()->hide();
break;
#ifndef QT_NO_GESTURES
@@ -4886,22 +4886,22 @@ QInputContext *QApplication::inputContext() const
\since 4.2
\obsolete
- Returns the current keyboard input locale. Replaced with QInputPanel::locale()
+ Returns the current keyboard input locale. Replaced with QInputMethod::locale()
*/
QLocale QApplication::keyboardInputLocale()
{
- return qApp ? qApp->inputPanel()->locale() : QLocale::c();
+ return qApp ? qApp->inputMethod()->locale() : QLocale::c();
}
/*!
\since 4.2
\obsolete
- Returns the current keyboard input direction. Replaced with QInputPanel::inputDirection()
+ Returns the current keyboard input direction. Replaced with QInputMethod::inputDirection()
*/
Qt::LayoutDirection QApplication::keyboardInputDirection()
{
- return qApp ? qApp->inputPanel()->inputDirection() : Qt::LeftToRight;
+ return qApp ? qApp->inputMethod()->inputDirection() : Qt::LeftToRight;
}
bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event)
diff --git a/src/widgets/kernel/qinputcontext.cpp b/src/widgets/kernel/qinputcontext.cpp
index 53e9cce553..fcbee624f5 100644
--- a/src/widgets/kernel/qinputcontext.cpp
+++ b/src/widgets/kernel/qinputcontext.cpp
@@ -65,7 +65,7 @@
#include "qmenu.h"
#include "qtextformat.h"
#include "qpalette.h"
-#include <QtGui/qinputpanel.h>
+#include <QtGui/qinputmethod.h>
#include <QtGui/qevent.h>
#include <stdlib.h>
@@ -228,7 +228,7 @@ void QInputContext::setFocusWidget(QWidget *widget)
void QInputContext::sendEvent(const QInputMethodEvent &event)
{
- QObject *focus = qApp->inputPanel()->inputItem();
+ QObject *focus = qApp->inputMethod()->inputItem();
if (!focus)
return;
@@ -257,7 +257,7 @@ void QInputContext::sendEvent(const QInputMethodEvent &event)
void QInputContext::mouseHandler(int x, QMouseEvent *event)
{
if (event->type() == QEvent::MouseButtonRelease)
- qApp->inputPanel()->invokeAction(QInputPanel::Click, x);
+ qApp->inputMethod()->invokeAction(QInputMethod::Click, x);
}
@@ -280,7 +280,7 @@ QFont QInputContext::font() const
*/
void QInputContext::update()
{
- qApp->inputPanel()->update(Qt::ImQueryAll);
+ qApp->inputMethod()->update(Qt::ImQueryAll);
}
/*!
@@ -291,7 +291,7 @@ void QInputContext::update()
void QInputContext::widgetDestroyed(QWidget *widget)
{
Q_UNUSED(widget)
- // nothing to be done here, as we use a weak pointer in the input panel
+ // nothing to be done here, as we use a weak pointer in the input method
}
/*!
@@ -316,7 +316,7 @@ void QInputContext::widgetDestroyed(QWidget *widget)
*/
void QInputContext::reset()
{
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 321a374652..2a7497947d 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -78,7 +78,7 @@
#include "qinputcontext.h"
#include "qfileinfo.h"
#include "private/qsoftkeymanager_p.h"
-#include <QtGui/qinputpanel.h>
+#include <QtGui/qinputmethod.h>
#include <private/qgraphicseffect_p.h>
#include <qbackingstore.h>
@@ -354,7 +354,7 @@ void QWidgetPrivate::updateWidgetTransform()
QTransform t;
QPoint p = q->mapTo(q->topLevelWidget(), QPoint(0,0));
t.translate(p.x(), p.y());
- qApp->inputPanel()->setInputItemTransform(t);
+ qApp->inputMethod()->setInputItemTransform(t);
}
}
@@ -3106,10 +3106,10 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
if (enable) {
if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled))
- qApp->inputPanel()->update(Qt::ImEnabled);
+ qApp->inputMethod()->update(Qt::ImEnabled);
} else {
- qApp->inputPanel()->reset();
- qApp->inputPanel()->update(Qt::ImEnabled);
+ qApp->inputMethod()->reset();
+ qApp->inputMethod()->update(Qt::ImEnabled);
}
}
#endif //QT_NO_IM
@@ -8811,7 +8811,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
#ifndef QT_NO_IM
Q_D(QWidget);
d->imHints = hints;
- qApp->inputPanel()->update(Qt::ImHints);
+ qApp->inputMethod()->update(Qt::ImHints);
#endif //QT_NO_IM
}
@@ -10030,8 +10030,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
QWidget *focusWidget = d->effectiveFocusWidget();
if (on && !internalWinId() && hasFocus()
&& focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) {
- qApp->inputPanel()->reset();
- qApp->inputPanel()->update(Qt::ImEnabled);
+ qApp->inputMethod()->reset();
+ qApp->inputMethod()->update(Qt::ImEnabled);
}
if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget()
#ifdef Q_WS_MAC
@@ -10045,7 +10045,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->createWinId();
if (isEnabled() && focusWidget->isEnabled()
&& focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) {
- qApp->inputPanel()->update(Qt::ImEnabled);
+ qApp->inputMethod()->update(Qt::ImEnabled);
}
#endif //QT_NO_IM
break;
@@ -10080,8 +10080,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
#ifndef QT_NO_IM
if (qApp->focusObject() == this) {
if (!on)
- qApp->inputPanel()->reset();
- qApp->inputPanel()->update(Qt::ImEnabled);
+ qApp->inputMethod()->reset();
+ qApp->inputMethod()->update(Qt::ImEnabled);
}
#endif //QT_NO_IM
break;
@@ -10513,7 +10513,7 @@ void QWidget::setShortcutAutoRepeat(int id, bool enable)
void QWidget::updateMicroFocus()
{
// updating everything since this is currently called for any kind of state change
- qApp->inputPanel()->update(Qt::ImQueryAll);
+ qApp->inputMethod()->update(Qt::ImQueryAll);
#ifndef QT_NO_ACCESSIBILITY
if (isVisible()) {
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index e600908e27..0da0c65aaa 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -59,7 +59,7 @@
#include "QtCore/qlocale.h"
#include "QtCore/qset.h"
#include "QtGui/qregion.h"
-#include "QtGui/qinputpanel.h"
+#include "QtGui/qinputmethod.h"
#include "QtWidgets/qsizepolicy.h"
#include "QtWidgets/qstyle.h"
#include "QtWidgets/qapplication.h"
@@ -416,7 +416,7 @@ public:
void syncBackingStore();
void syncBackingStore(const QRegion &region);
- // tells the input panel about the widgets transform
+ // tells the input method about the widgets transform
void updateWidgetTransform();
void reparentFocusWidgets(QWidget *oldtlw);
@@ -573,7 +573,7 @@ public:
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
q->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
- qApp->inputPanel()->show();
+ qApp->inputMethod()->show();
}
}
}
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index a3958cfd1a..d6af8d6044 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -2458,7 +2458,7 @@ void QComboBox::showPopup()
}
if (qApp) {
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
}
QScrollBar *sb = view()->horizontalScrollBar();
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index bd4fcf6159..77d6f5422a 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1202,7 +1202,7 @@ void QLineEdit::insert(const QString &newText)
void QLineEdit::clear()
{
Q_D(QLineEdit);
- d->resetInputPanel();
+ d->resetInputMethod();
d->control->clear();
}
@@ -1215,7 +1215,7 @@ void QLineEdit::clear()
void QLineEdit::undo()
{
Q_D(QLineEdit);
- d->resetInputPanel();
+ d->resetInputMethod();
d->control->undo();
}
@@ -1226,7 +1226,7 @@ void QLineEdit::undo()
void QLineEdit::redo()
{
Q_D(QLineEdit);
- d->resetInputPanel();
+ d->resetInputMethod();
d->control->redo();
}
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 5687abde3c..e3404a62de 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -51,7 +51,7 @@
#include "qaccessible.h"
#endif
#ifndef QT_NO_IM
-#include "qinputpanel.h"
+#include "qinputmethod.h"
#include "qlist.h"
#endif
@@ -242,17 +242,17 @@ void QLineEditPrivate::updatePasswordEchoEditing(bool editing)
q->setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod());
}
-void QLineEditPrivate::resetInputPanel()
+void QLineEditPrivate::resetInputMethod()
{
Q_Q(QLineEdit);
if (q->hasFocus() && qApp) {
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
}
}
/*!
This function is not intended as polymorphic usage. Just a shared code
- fragment that calls QInputPanel::invokeAction for this
+ fragment that calls QInputMethod::invokeAction for this
class.
*/
bool QLineEditPrivate::sendMouseEventToInputContext( QMouseEvent *e )
@@ -266,7 +266,7 @@ bool QLineEditPrivate::sendMouseEventToInputContext( QMouseEvent *e )
if (mousePos >= 0) {
if (e->type() == QEvent::MouseButtonRelease)
- qApp->inputPanel()->invokeAction(QInputPanel::Click, mousePos);
+ qApp->inputMethod()->invokeAction(QInputMethod::Click, mousePos);
return true;
}
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 0b4f3ba232..3b7a0d1b91 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -102,7 +102,7 @@ public:
void updatePasswordEchoEditing(bool);
- void resetInputPanel();
+ void resetInputMethod();
inline bool shouldEnableInputMethod() const
{
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index c774198d8f..2f5793bcba 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -206,7 +206,7 @@ void QWidgetLineControl::commitPreedit()
if (!composeMode())
return;
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
if (!m_tentativeCommit.isEmpty()) {
internalInsert(m_tentativeCommit);
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 566b930024..1d955363e6 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -62,7 +62,7 @@
#include "QtWidgets/qstyleoption.h"
#include "QtCore/qpointer.h"
#include "QtGui/qclipboard.h"
-#include "QtGui/qinputpanel.h"
+#include "QtGui/qinputmethod.h"
#include "QtCore/qpoint.h"
#include "QtWidgets/qcompleter.h"
#include "QtCore/qthread.h"
@@ -232,7 +232,7 @@ public:
void setText(const QString &txt)
{
if (composeMode())
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
m_tentativeCommit.clear();
internalSetText(txt, -1, false);
}
@@ -318,7 +318,7 @@ public:
Qt::LayoutDirection layoutDirection() const {
if (m_layoutDirection == Qt::LayoutDirectionAuto) {
if (m_text.isEmpty())
- return qApp->inputPanel()->inputDirection();
+ return qApp->inputMethod()->inputDirection();
return m_text.isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight;
}
return m_layoutDirection;
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index e4f461db76..96389b8333 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -75,7 +75,7 @@
#include <qvariant.h>
#include <qurl.h>
#include <qdesktopservices.h>
-#include <qinputpanel.h>
+#include <qinputmethod.h>
#include <qtooltip.h>
#include <qstyleoption.h>
#include <QtWidgets/qlineedit.h>
@@ -1689,7 +1689,7 @@ void QWidgetTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button
_q_updateCurrentCharFormatAndSelection();
#ifndef QT_NO_IM
if (contextWidget)
- qApp->inputPanel()->update(Qt::ImQueryInput);
+ qApp->inputMethod()->update(Qt::ImQueryInput);
#endif //QT_NO_IM
} else {
//emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1)));
@@ -1836,7 +1836,7 @@ bool QWidgetTextControlPrivate::sendMouseEventToInputContext(
if (cursorPos >= 0) {
if (e->type() == QEvent::MouseButtonRelease)
- qApp->inputPanel()->invokeAction(QInputPanel::Click, cursorPos);
+ qApp->inputMethod()->invokeAction(QInputMethod::Click, cursorPos);
e->setAccepted(true);
return true;
@@ -2755,7 +2755,7 @@ void QWidgetTextControlPrivate::commitPreedit()
return;
cursor.beginEditBlock();
- qApp->inputPanel()->reset();
+ qApp->inputMethod()->reset();
if (!tentativeCommit.isEmpty()) {
cursor.insertText(tentativeCommit);