diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-06-22 16:00:08 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-22 08:18:15 +0200 |
commit | 3721de405e8556a25b66f7bc4bc946ba35b45292 (patch) | |
tree | f1bd35e5bce63b23ae39b7c2a5640b6532b53298 /src/quick/items/qquicktextedit.cpp | |
parent | b46d5a53c80580eb241dfd8751118cf6893d5cf8 (diff) |
Remove the open and closeSofwareInputPanel functions.
Functionality is provided by the global Qt.application.inputMethod
object.
Task-number: QTBUG-21449
Change-Id: I75c082bcbe44c8834ccaf966a3f9a09ab91ec290
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r-- | src/quick/items/qquicktextedit.cpp | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 058b8161c4..52067855ba 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -1480,7 +1480,7 @@ void QQuickTextEdit::mousePressEvent(QMouseEvent *event) forceActiveFocus(); // re-open input panel on press if already focused if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) - openSoftwareInputPanel(); + qGuiApp->inputMethod()->show(); } if (!event->isAccepted()) QQuickImplicitSizeItem::mousePressEvent(event); @@ -2044,99 +2044,11 @@ void QQuickTextEditPrivate::updateDefaultTextOption() } } - - -/*! - \qmlmethod void QtQuick2::TextEdit::openSoftwareInputPanel() - - Opens software input panels like virtual keyboards for typing, useful for - customizing when you want the input keyboard to be shown and hidden in - your application. - - By default the opening of input panels follows the platform style. Input panels are - always closed if no editor has active focus. - - You can disable the automatic behavior by setting the property \c activeFocusOnPress to false - and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement - the behavior you want. - - Only relevant on platforms, which provide virtual keyboards. - - \code - import QtQuick 2.0 - TextEdit { - id: textEdit - text: "Hello world!" - activeFocusOnPress: false - MouseArea { - anchors.fill: parent - onClicked: { - if (!textEdit.activeFocus) { - textEdit.forceActiveFocus(); - textEdit.openSoftwareInputPanel(); - } else { - textEdit.focus = false; - } - } - onPressAndHold: textEdit.closeSoftwareInputPanel(); - } - } - \endcode -*/ -void QQuickTextEdit::openSoftwareInputPanel() -{ - if (qGuiApp) - qGuiApp->inputMethod()->show(); -} - -/*! - \qmlmethod void QtQuick2::TextEdit::closeSoftwareInputPanel() - - Closes a software input panel like a virtual keyboard shown on the screen, useful - for customizing when you want the input keyboard to be shown and hidden in - your application. - - By default the opening of input panels follows the platform style. Input panels are - always closed if no editor has active focus. - - You can disable the automatic behavior by setting the property \c activeFocusOnPress to false - and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement - the behavior you want. - - Only relevant on platforms, which provide virtual keyboards. - - \code - import QtQuick 2.0 - TextEdit { - id: textEdit - text: "Hello world!" - activeFocusOnPress: false - MouseArea { - anchors.fill: parent - onClicked: { - if (!textEdit.activeFocus) { - textEdit.forceActiveFocus(); - textEdit.openSoftwareInputPanel(); - } else { - textEdit.focus = false; - } - } - onPressAndHold: textEdit.closeSoftwareInputPanel(); - } - } - \endcode -*/ -void QQuickTextEdit::closeSoftwareInputPanel() -{ - if (qGuiApp) - qGuiApp->inputMethod()->hide(); -} - void QQuickTextEdit::focusInEvent(QFocusEvent *event) { Q_D(const QQuickTextEdit); if (d->focusOnPress && !isReadOnly()) - openSoftwareInputPanel(); + qGuiApp->inputMethod()->show(); QQuickImplicitSizeItem::focusInEvent(event); } |