From 01669a3cd270f66de1bf985c4630a708e9872a83 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 23 Apr 2012 06:18:19 +0200 Subject: [PATCH] api: remove references to inputPanel. Qt.application.inputPanel is now Qt.inputMethod. Also, QGuiApplication::inputPanel is being removed. Change-Id: I0033183235fe0fda6adff13cf5eaf4b8206d91fb Reviewed-by: Lars Knoll --- src/qml/qml/qqmlengine.cpp | 8 -------- src/quick/util/qquickapplication.cpp | 10 ---------- src/quick/util/qquickapplication_p.h | 2 -- src/quick/util/qquickutilmodule.cpp | 2 -- .../quick/qquickapplication/tst_qquickapplication.cpp | 17 ----------------- 5 files changed, 39 deletions(-) diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index c1ce012..cef878a 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -326,14 +326,6 @@ of their use. from right to left. \endlist - \row - \li \c application.inputPanel - \li - This read-only property allows access to application's QInputPanel object - and all its properties and slots. See the QInputPanel documentation for - further details. Deprecated in favor of Qt.InputMethod - \endtable - The following example uses the \c application object to indicate whether the application is currently active: diff --git a/src/quick/util/qquickapplication.cpp b/src/quick/util/qquickapplication.cpp index 55ebb11..50796a0 100644 --- a/src/quick/util/qquickapplication.cpp +++ b/src/quick/util/qquickapplication.cpp @@ -91,16 +91,6 @@ Qt::LayoutDirection QQuickApplication::layoutDirection() const return d->direction; } -QObject *QQuickApplication::inputPanel() const -{ - static bool warned = false; - if (!warned) { - qWarning() << "Qt.application.inputPanel is deprecated, use Qt.inputMethod instead"; - warned = true; - } - return qGuiApp->inputMethod(); -} - bool QQuickApplication::eventFilter(QObject *, QEvent *event) { Q_D(QQuickApplication); diff --git a/src/quick/util/qquickapplication_p.h b/src/quick/util/qquickapplication_p.h index e8a3cd5..a502c70 100644 --- a/src/quick/util/qquickapplication_p.h +++ b/src/quick/util/qquickapplication_p.h @@ -57,14 +57,12 @@ class Q_QUICK_PRIVATE_EXPORT QQuickApplication : public QObject Q_OBJECT Q_PROPERTY(bool active READ active NOTIFY activeChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged) - Q_PROPERTY(QObject *inputPanel READ inputPanel CONSTANT) public: explicit QQuickApplication(QObject *parent = 0); virtual ~QQuickApplication(); bool active() const; Qt::LayoutDirection layoutDirection() const; - QT_DEPRECATED QObject *inputPanel() const; Q_SIGNALS: void activeChanged(); diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp index 4abbfe5..01ce768 100644 --- a/src/quick/util/qquickutilmodule.cpp +++ b/src/quick/util/qquickutilmodule.cpp @@ -65,8 +65,6 @@ void QQuickUtilModule::defineModule() { - qmlRegisterUncreatableType("QtQuick",2,0,"InputPanel", - QInputMethod::tr("InputPanel is an abstract class")); // deprecated qmlRegisterUncreatableType("QtQuick",2,0,"InputMethod", QInputMethod::tr("InputMethod is an abstract class")); qmlRegisterUncreatableType("QtQuick",2,0,"Animation",QQuickAbstractAnimation::tr("Animation is an abstract class")); diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp index 4dd7688..3d02dce 100644 --- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp +++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp @@ -55,7 +55,6 @@ public: private slots: void active(); void layoutDirection(); - void inputPanel(); void inputMethod(); private: @@ -136,22 +135,6 @@ void tst_qquickapplication::layoutDirection() QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight); } -void tst_qquickapplication::inputPanel() -{ - const QLatin1String expected("Qt.application.inputPanel is deprecated, use Qt.inputMethod instead "); - QTest::ignoreMessage(QtWarningMsg, expected.data()); - - QQmlComponent component(&engine); - component.setData("import QtQuick 2.0; Item { property variant inputPanel: Qt.application.inputPanel }", QUrl::fromLocalFile("")); - QQuickItem *item = qobject_cast(component.create()); - QVERIFY(item); - QQuickView view; - item->setParentItem(view.rootObject()); - - // check that the inputPanel property maches with application's input panel - QCOMPARE(qvariant_cast(item->property("inputPanel")), qApp->inputMethod()); -} - void tst_qquickapplication::inputMethod() { // technically not in QQuickApplication, but testing anyway here -- 2.7.4