api: remove references to inputPanel.
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Mon, 23 Apr 2012 04:18:19 +0000 (06:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 26 Apr 2012 16:47:35 +0000 (18:47 +0200)
Qt.application.inputPanel is now Qt.inputMethod. Also,
QGuiApplication::inputPanel is being removed.

Change-Id: I0033183235fe0fda6adff13cf5eaf4b8206d91fb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/qml/qml/qqmlengine.cpp
src/quick/util/qquickapplication.cpp
src/quick/util/qquickapplication_p.h
src/quick/util/qquickutilmodule.cpp
tests/auto/quick/qquickapplication/tst_qquickapplication.cpp

index c1ce012..cef878a 100644 (file)
@@ -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:
 
index 55ebb11..50796a0 100644 (file)
@@ -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);
index e8a3cd5..a502c70 100644 (file)
@@ -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();
index 4abbfe5..01ce768 100644 (file)
@@ -65,8 +65,6 @@
 
 void QQuickUtilModule::defineModule()
 {
-    qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputPanel",
-                                             QInputMethod::tr("InputPanel is an abstract class")); // deprecated
     qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputMethod",
                                              QInputMethod::tr("InputMethod is an abstract class"));
     qmlRegisterUncreatableType<QQuickAbstractAnimation>("QtQuick",2,0,"Animation",QQuickAbstractAnimation::tr("Animation is an abstract class"));
index 4dd7688..3d02dce 100644 (file)
@@ -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<QQuickItem *>(component.create());
-    QVERIFY(item);
-    QQuickView view;
-    item->setParentItem(view.rootObject());
-
-    // check that the inputPanel property maches with application's input panel
-    QCOMPARE(qvariant_cast<QObject*>(item->property("inputPanel")), qApp->inputMethod());
-}
-
 void tst_qquickapplication::inputMethod()
 {
     // technically not in QQuickApplication, but testing anyway here