Move no-Gui related QML types from QtQuick into QtQml
authorTasuku Suzuki <stasuku@gmail.com>
Sat, 24 Nov 2012 19:36:33 +0000 (04:36 +0900)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 29 Nov 2012 16:48:46 +0000 (17:48 +0100)
Task-number: QTBUG-26340

Change-Id: I9049128db2598bf3c7a9d677b774eaae53b54eb5
Reviewed-by: Alan Alpert <aalpert@rim.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
52 files changed:
src/qml/qml/qml.pri
src/qml/qml/qqmlbind.cpp [moved from src/quick/util/qquickbind.cpp with 87% similarity]
src/qml/qml/qqmlbind_p.h [moved from src/quick/util/qquickbind_p.h with 90% similarity]
src/qml/qml/qqmlconnections.cpp [moved from src/quick/util/qquickconnections.cpp with 85% similarity]
src/qml/qml/qqmlconnections_p.h [moved from src/quick/util/qquickconnections_p.h with 90% similarity]
src/qml/qml/qqmlengine.cpp
src/qml/qml/qqmltimer.cpp [moved from src/quick/util/qquicktimer.cpp with 85% similarity]
src/qml/qml/qqmltimer_p.h [moved from src/quick/util/qquicktimer_p.h with 91% similarity]
src/quick/util/qquickutilmodule.cpp
src/quick/util/util.pri
tests/auto/qml/qml.pro
tests/auto/qml/qqmlbinding/data/deletedObject.qml [moved from tests/auto/qml/qquickbinding/data/deletedObject.qml with 100% similarity]
tests/auto/qml/qqmlbinding/data/restoreBinding.qml [moved from tests/auto/qml/qquickbinding/data/restoreBinding.qml with 100% similarity]
tests/auto/qml/qqmlbinding/data/restoreBindingWithLoop.qml [moved from tests/auto/qml/qquickbinding/data/restoreBindingWithLoop.qml with 100% similarity]
tests/auto/qml/qqmlbinding/data/restoreBindingWithoutCrash.qml [moved from tests/auto/qml/qquickbinding/data/restoreBindingWithoutCrash.qml with 100% similarity]
tests/auto/qml/qqmlbinding/data/test-binding.qml [moved from tests/auto/qml/qquickbinding/data/test-binding.qml with 100% similarity]
tests/auto/qml/qqmlbinding/data/test-binding2.qml [moved from tests/auto/qml/qquickbinding/data/test-binding2.qml with 100% similarity]
tests/auto/qml/qqmlbinding/qqmlbinding.pro [moved from tests/auto/qml/qquickbinding/qquickbinding.pro with 79% similarity]
tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp [moved from tests/auto/qml/qquickbinding/tst_qquickbinding.cpp with 91% similarity]
tests/auto/qml/qqmlconnections/data/connection-targetchange.qml [moved from tests/auto/qml/qquickconnection/data/connection-targetchange.qml with 100% similarity]
tests/auto/qml/qqmlconnections/data/connection-unknownsignals-ignored.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/connection-unknownsignals-notarget.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/connection-unknownsignals-parent.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/connection-unknownsignals.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/error-object.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/error-property.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/error-property2.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/error-syntax.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/rewriteError-global.qml [moved from tests/auto/qml/qquickconnection/data/rewriteError-global.qml with 87% similarity]
tests/auto/qml/qqmlconnections/data/rewriteError-unnamed.qml [moved from tests/auto/qml/qquickconnection/data/rewriteError-unnamed.qml with 100% similarity]
tests/auto/qml/qqmlconnections/data/singletontype-target.qml [moved from tests/auto/qml/qquickconnection/data/singletontype-target.qml with 89% similarity]
tests/auto/qml/qqmlconnections/data/test-connection.qml [moved from tests/auto/qml/qquickconnection/data/test-connection.qml with 100% similarity]
tests/auto/qml/qqmlconnections/data/test-connection2.qml [moved from tests/auto/qml/qquickconnection/data/test-connection2.qml with 80% similarity]
tests/auto/qml/qqmlconnections/data/test-connection3.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/data/trimming.qml [new file with mode: 0644]
tests/auto/qml/qqmlconnections/qqmlconnections.pro [moved from tests/auto/qml/qquickconnection/qquickconnection.pro with 78% similarity]
tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp [moved from tests/auto/qml/qquickconnection/tst_qquickconnection.cpp with 84% similarity]
tests/auto/qml/qqmlengine/data/qtqmlModule.5.qml
tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
tests/auto/qml/qqmltimer/qqmltimer.pro [moved from tests/auto/quick/qquicktimer/qquicktimer.pro with 76% similarity]
tests/auto/qml/qqmltimer/tst_qqmltimer.cpp [moved from tests/auto/quick/qquicktimer/tst_qquicktimer.cpp with 78% similarity]
tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml [deleted file]
tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml [deleted file]
tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml [deleted file]
tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml [deleted file]
tests/auto/qml/qquickconnection/data/error-object.qml [deleted file]
tests/auto/qml/qquickconnection/data/error-property.qml [deleted file]
tests/auto/qml/qquickconnection/data/error-property2.qml [deleted file]
tests/auto/qml/qquickconnection/data/error-syntax.qml [deleted file]
tests/auto/qml/qquickconnection/data/test-connection3.qml [deleted file]
tests/auto/qml/qquickconnection/data/trimming.qml [deleted file]
tests/auto/quick/quick.pro

index e7286c2..20b46f0 100644 (file)
@@ -52,7 +52,10 @@ SOURCES += \
     $$PWD/qqmlglobal.cpp \
     $$PWD/qqmlfile.cpp \
     $$PWD/qqmlbundle.cpp \
-    $$PWD/qqmlmemoryprofiler.cpp
+    $$PWD/qqmlmemoryprofiler.cpp \
+    $$PWD/qqmlconnections.cpp \
+    $$PWD/qqmltimer.cpp \
+    $$PWD/qqmlbind.cpp
 
 HEADERS += \
     $$PWD/qqmlglobal_p.h \
@@ -125,7 +128,11 @@ HEADERS += \
     $$PWD/qqmlvaluetypeproxybinding_p.h \
     $$PWD/qqmlfile.h \
     $$PWD/qqmlbundle_p.h \
-    $$PWD/qqmlmemoryprofiler_p.h
+    $$PWD/qqmlmemoryprofiler_p.h \
+    $$PWD/qqmlconnections_p.h \
+    $$PWD/qqmltimer_p.h \
+    $$PWD/qqmlbind_p.h
+
 
 include(parser/parser.pri)
 include(rewriter/rewriter.pri)
similarity index 87%
rename from src/quick/util/qquickbind.cpp
rename to src/qml/qml/qqmlbind.cpp
index 7d3bc06..2df9693 100644 (file)
@@ -39,7 +39,7 @@
 **
 ****************************************************************************/
 
-#include "qquickbind_p.h"
+#include "qqmlbind_p.h"
 
 #include <private/qqmlnullablevalue_p_p.h>
 #include <private/qqmlproperty_p.h>
 
 QT_BEGIN_NAMESPACE
 
-class QQuickBindPrivate : public QObjectPrivate
+class QQmlBindPrivate : public QObjectPrivate
 {
 public:
-    QQuickBindPrivate() : componentComplete(true), obj(0), prevBind(0) {}
-    ~QQuickBindPrivate() { if (prevBind) prevBind->destroy(); }
+    QQmlBindPrivate() : componentComplete(true), obj(0), prevBind(0) {}
+    ~QQmlBindPrivate() { if (prevBind) prevBind->destroy(); }
 
     QQmlNullableValue<bool> when;
     bool componentComplete;
@@ -76,7 +76,7 @@ public:
 
 /*!
     \qmltype Binding
-    \instantiates QQuickBind
+    \instantiates QQmlBind
     \inqmlmodule QtQuick 2
     \ingroup qtquick-interceptors
     \brief Enables the arbitrary creation of property bindings
@@ -141,12 +141,12 @@ public:
 
     \sa QtQml
 */
-QQuickBind::QQuickBind(QObject *parent)
-    : QObject(*(new QQuickBindPrivate), parent)
+QQmlBind::QQmlBind(QObject *parent)
+    : QObject(*(new QQmlBindPrivate), parent)
 {
 }
 
-QQuickBind::~QQuickBind()
+QQmlBind::~QQmlBind()
 {
 }
 
@@ -166,15 +166,15 @@ QQuickBind::~QQuickBind()
     When the binding becomes inactive again, any direct bindings that were previously
     set on the property will be restored.
 */
-bool QQuickBind::when() const
+bool QQmlBind::when() const
 {
-    Q_D(const QQuickBind);
+    Q_D(const QQmlBind);
     return d->when;
 }
 
-void QQuickBind::setWhen(bool v)
+void QQmlBind::setWhen(bool v)
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     if (!d->when.isNull && d->when == v)
         return;
 
@@ -187,15 +187,15 @@ void QQuickBind::setWhen(bool v)
 
     The object to be updated.
 */
-QObject *QQuickBind::object()
+QObject *QQmlBind::object()
 {
-    Q_D(const QQuickBind);
+    Q_D(const QQmlBind);
     return d->obj;
 }
 
-void QQuickBind::setObject(QObject *obj)
+void QQmlBind::setObject(QObject *obj)
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     if (d->obj && d->when.isValid() && d->when) {
         /* if we switch the object at runtime, we need to restore the
            previous binding on the old object before continuing */
@@ -214,15 +214,15 @@ void QQuickBind::setObject(QObject *obj)
 
     The property to be updated.
 */
-QString QQuickBind::property() const
+QString QQmlBind::property() const
 {
-    Q_D(const QQuickBind);
+    Q_D(const QQmlBind);
     return d->propName;
 }
 
-void QQuickBind::setProperty(const QString &p)
+void QQmlBind::setProperty(const QString &p)
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     if (!d->propName.isEmpty() && d->when.isValid() && d->when) {
         /* if we switch the property name at runtime, we need to restore the
            previous binding on the old object before continuing */
@@ -242,43 +242,43 @@ void QQuickBind::setProperty(const QString &p)
     The value to be set on the target object and property.  This can be a
     constant (which isn't very useful), or a bound expression.
 */
-QVariant QQuickBind::value() const
+QVariant QQmlBind::value() const
 {
-    Q_D(const QQuickBind);
+    Q_D(const QQmlBind);
     return d->value.value;
 }
 
-void QQuickBind::setValue(const QVariant &v)
+void QQmlBind::setValue(const QVariant &v)
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     d->value = v;
     eval();
 }
 
-void QQuickBind::setTarget(const QQmlProperty &p)
+void QQmlBind::setTarget(const QQmlProperty &p)
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     d->prop = p;
 }
 
-void QQuickBind::classBegin()
+void QQmlBind::classBegin()
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     d->componentComplete = false;
 }
 
-void QQuickBind::componentComplete()
+void QQmlBind::componentComplete()
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     d->componentComplete = true;
     if (!d->prop.isValid())
         d->prop = QQmlProperty(d->obj, d->propName);
     eval();
 }
 
-void QQuickBind::eval()
+void QQmlBind::eval()
 {
-    Q_D(QQuickBind);
+    Q_D(QQmlBind);
     if (!d->prop.isValid() || d->value.isNull || !d->componentComplete)
         return;
 
similarity index 90%
rename from src/quick/util/qquickbind_p.h
rename to src/qml/qml/qqmlbind_p.h
index ced8aae..02e2767 100644 (file)
@@ -39,8 +39,8 @@
 **
 ****************************************************************************/
 
-#ifndef QQUICKBIND_H
-#define QQUICKBIND_H
+#ifndef QQMLBIND_H
+#define QQMLBIND_H
 
 #include <qqml.h>
 
@@ -50,11 +50,11 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
-class QQuickBindPrivate;
-class Q_AUTOTEST_EXPORT QQuickBind : public QObject, public QQmlPropertyValueSource, public QQmlParserStatus
+class QQmlBindPrivate;
+class Q_AUTOTEST_EXPORT QQmlBind : public QObject, public QQmlPropertyValueSource, public QQmlParserStatus
 {
     Q_OBJECT
-    Q_DECLARE_PRIVATE(QQuickBind)
+    Q_DECLARE_PRIVATE(QQmlBind)
     Q_INTERFACES(QQmlParserStatus)
     Q_INTERFACES(QQmlPropertyValueSource)
     Q_PROPERTY(QObject *target READ object WRITE setObject)
@@ -63,8 +63,8 @@ class Q_AUTOTEST_EXPORT QQuickBind : public QObject, public QQmlPropertyValueSou
     Q_PROPERTY(bool when READ when WRITE setWhen)
 
 public:
-    QQuickBind(QObject *parent=0);
-    ~QQuickBind();
+    QQmlBind(QObject *parent=0);
+    ~QQmlBind();
 
     bool when() const;
     void setWhen(bool);
@@ -89,7 +89,7 @@ private:
 
 QT_END_NAMESPACE
 
-QML_DECLARE_TYPE(QQuickBind)
+QML_DECLARE_TYPE(QQmlBind)
 
 QT_END_HEADER
 
similarity index 85%
rename from src/quick/util/qquickconnections.cpp
rename to src/qml/qml/qqmlconnections.cpp
index ea3628c..ab631ed 100644 (file)
@@ -39,7 +39,7 @@
 **
 ****************************************************************************/
 
-#include "qquickconnections_p.h"
+#include "qqmlconnections_p.h"
 
 #include <private/qqmlexpression_p.h>
 #include <private/qqmlproperty_p.h>
 
 QT_BEGIN_NAMESPACE
 
-class QQuickConnectionsPrivate : public QObjectPrivate
+class QQmlConnectionsPrivate : public QObjectPrivate
 {
 public:
-    QQuickConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
+    QQmlConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
 
     QList<QQmlBoundSignal*> boundsignals;
     QObject *target;
@@ -72,7 +72,7 @@ public:
 
 /*!
     \qmltype Connections
-    \instantiates QQuickConnections
+    \instantiates QQmlConnections
     \inqmlmodule QtQuick 2
     \ingroup qtquick-interceptors
     \brief Describes generalized connections to signals
@@ -128,12 +128,12 @@ public:
 
     \sa QtQml
 */
-QQuickConnections::QQuickConnections(QObject *parent) :
-    QObject(*(new QQuickConnectionsPrivate), parent)
+QQmlConnections::QQmlConnections(QObject *parent) :
+    QObject(*(new QQmlConnectionsPrivate), parent)
 {
 }
 
-QQuickConnections::~QQuickConnections()
+QQmlConnections::~QQmlConnections()
 {
 }
 
@@ -146,9 +146,9 @@ QQuickConnections::~QQuickConnections()
     If set to null, no connection is made and any signal handlers are ignored
     until the target is not null.
 */
-QObject *QQuickConnections::target() const
+QObject *QQmlConnections::target() const
 {
-    Q_D(const QQuickConnections);
+    Q_D(const QQmlConnections);
     return d->targetSet ? d->target : parent();
 }
 
@@ -162,9 +162,9 @@ private:
     QQmlBoundSignal *m_signal;
 };
 
-void QQuickConnections::setTarget(QObject *obj)
+void QQmlConnections::setTarget(QObject *obj)
 {
-    Q_D(QQuickConnections);
+    Q_D(QQmlConnections);
     d->targetSet = true; // even if setting to 0, it is *set*
     if (d->target == obj)
         return;
@@ -191,15 +191,15 @@ void QQuickConnections::setTarget(QObject *obj)
     This is useful if you intend to connect to different types of objects, handling
     a different set of signals for each object.
 */
-bool QQuickConnections::ignoreUnknownSignals() const
+bool QQmlConnections::ignoreUnknownSignals() const
 {
-    Q_D(const QQuickConnections);
+    Q_D(const QQmlConnections);
     return d->ignoreUnknownSignals;
 }
 
-void QQuickConnections::setIgnoreUnknownSignals(bool ignore)
+void QQmlConnections::setIgnoreUnknownSignals(bool ignore)
 {
-    Q_D(QQuickConnections);
+    Q_D(QQmlConnections);
     d->ignoreUnknownSignals = ignore;
 }
 
@@ -218,7 +218,7 @@ QQmlConnectionsParser::compile(const QList<QQmlCustomParserProperty> &props)
         int propColumn = props.at(ii).location().column;
 
         if (!propName.startsWith(QLatin1String("on")) || !propName.at(2).isUpper()) {
-            error(props.at(ii), QQuickConnections::tr("Cannot assign to non-existent property \"%1\"").arg(propName));
+            error(props.at(ii), QQmlConnections::tr("Cannot assign to non-existent property \"%1\"").arg(propName));
             return QByteArray();
         }
 
@@ -228,10 +228,10 @@ QQmlConnectionsParser::compile(const QList<QQmlCustomParserProperty> &props)
             const QVariant &value = values.at(i);
 
             if (value.userType() == qMetaTypeId<QQmlCustomParserNode>()) {
-                error(props.at(ii), QQuickConnections::tr("Connections: nested objects not allowed"));
+                error(props.at(ii), QQmlConnections::tr("Connections: nested objects not allowed"));
                 return QByteArray();
             } else if (value.userType() == qMetaTypeId<QQmlCustomParserProperty>()) {
-                error(props.at(ii), QQuickConnections::tr("Connections: syntax error"));
+                error(props.at(ii), QQmlConnections::tr("Connections: syntax error"));
                 return QByteArray();
             } else {
                 QQmlScript::Variant v = qvariant_cast<QQmlScript::Variant>(value);
@@ -241,7 +241,7 @@ QQmlConnectionsParser::compile(const QList<QQmlCustomParserProperty> &props)
                     ds << propLine;
                     ds << propColumn;
                 } else {
-                    error(props.at(ii), QQuickConnections::tr("Connections: script expected"));
+                    error(props.at(ii), QQmlConnections::tr("Connections: script expected"));
                     return QByteArray();
                 }
             }
@@ -254,15 +254,15 @@ QQmlConnectionsParser::compile(const QList<QQmlCustomParserProperty> &props)
 void QQmlConnectionsParser::setCustomData(QObject *object,
                                             const QByteArray &data)
 {
-    QQuickConnectionsPrivate *p =
-        static_cast<QQuickConnectionsPrivate *>(QObjectPrivate::get(object));
+    QQmlConnectionsPrivate *p =
+        static_cast<QQmlConnectionsPrivate *>(QObjectPrivate::get(object));
     p->data = data;
 }
 
 
-void QQuickConnections::connectSignals()
+void QQmlConnections::connectSignals()
 {
-    Q_D(QQuickConnections);
+    Q_D(QQmlConnections);
     if (!d->componentcomplete || (d->targetSet && !target()))
         return;
 
@@ -305,15 +305,15 @@ void QQuickConnections::connectSignals()
     }
 }
 
-void QQuickConnections::classBegin()
+void QQmlConnections::classBegin()
 {
-    Q_D(QQuickConnections);
+    Q_D(QQmlConnections);
     d->componentcomplete=false;
 }
 
-void QQuickConnections::componentComplete()
+void QQmlConnections::componentComplete()
 {
-    Q_D(QQuickConnections);
+    Q_D(QQmlConnections);
     d->componentcomplete=true;
     connectSignals();
 }
similarity index 90%
rename from src/quick/util/qquickconnections_p.h
rename to src/qml/qml/qqmlconnections_p.h
index 0a8e716..5791166 100644 (file)
@@ -39,8 +39,8 @@
 **
 ****************************************************************************/
 
-#ifndef QQUICKCONNECTIONS_H
-#define QQUICKCONNECTIONS_H
+#ifndef QQMLCONNECTIONS_H
+#define QQMLCONNECTIONS_H
 
 #include <qqml.h>
 #include <private/qqmlcustomparser_p.h>
@@ -54,19 +54,19 @@ QT_BEGIN_NAMESPACE
 
 class QQmlBoundSignal;
 class QQmlContext;
-class QQuickConnectionsPrivate;
-class Q_AUTOTEST_EXPORT QQuickConnections : public QObject, public QQmlParserStatus
+class QQmlConnectionsPrivate;
+class Q_AUTOTEST_EXPORT QQmlConnections : public QObject, public QQmlParserStatus
 {
     Q_OBJECT
-    Q_DECLARE_PRIVATE(QQuickConnections)
+    Q_DECLARE_PRIVATE(QQmlConnections)
 
     Q_INTERFACES(QQmlParserStatus)
     Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
     Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
 
 public:
-    QQuickConnections(QObject *parent=0);
-    ~QQuickConnections();
+    QQmlConnections(QObject *parent=0);
+    ~QQmlConnections();
 
     QObject *target() const;
     void setTarget(QObject *);
@@ -93,7 +93,7 @@ public:
 
 QT_END_NAMESPACE
 
-QML_DECLARE_TYPE(QQuickConnections)
+QML_DECLARE_TYPE(QQmlConnections)
 
 QT_END_HEADER
 
index 1376ad7..9db8927 100644 (file)
 
 #include <private/qqmllocale_p.h>
 
+#include "qqmlbind_p.h"
+#include "qqmlconnections_p.h"
+#include "qqmltimer_p.h"
+
 #ifdef Q_OS_WIN // for %APPDATA%
 #include <qt_windows.h>
 #include <qlibrary.h>
@@ -172,6 +176,10 @@ void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int
 {
     qmlRegisterType<QQmlComponent>(uri,versionMajor,versionMinor,"Component");
     qmlRegisterType<QObject>(uri,versionMajor,versionMinor,"QtObject");
+    qmlRegisterType<QQmlBind>(uri, versionMajor, versionMinor,"Binding");
+    qmlRegisterType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections");
+    qmlRegisterType<QQmlTimer>(uri, versionMajor, versionMinor,"Timer");
+    qmlRegisterCustomType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections", new QQmlConnectionsParser);
 }
 
 
similarity index 85%
rename from src/quick/util/qquicktimer.cpp
rename to src/qml/qml/qqmltimer.cpp
index c7cdc70..c07a28c 100644 (file)
@@ -39,7 +39,7 @@
 **
 ****************************************************************************/
 
-#include "qquicktimer_p.h"
+#include "qqmltimer_p.h"
 
 #include <QtCore/qcoreapplication.h>
 #include "private/qpauseanimationjob_p.h"
@@ -51,16 +51,16 @@ QT_BEGIN_NAMESPACE
 
 
 
-class QQuickTimerPrivate : public QObjectPrivate, public QAnimationJobChangeListener
+class QQmlTimerPrivate : public QObjectPrivate, public QAnimationJobChangeListener
 {
-    Q_DECLARE_PUBLIC(QQuickTimer)
+    Q_DECLARE_PUBLIC(QQmlTimer)
 public:
-    QQuickTimerPrivate()
+    QQmlTimerPrivate()
         : interval(1000), running(false), repeating(false), triggeredOnStart(false)
         , classBegun(false), componentComplete(false), firstTick(true) {}
 
     virtual void animationFinished(QAbstractAnimationJob *);
-    virtual void animationCurrentLoopChanged(QAbstractAnimationJob *)  { Q_Q(QQuickTimer); q->ticked(); }
+    virtual void animationCurrentLoopChanged(QAbstractAnimationJob *)  { Q_Q(QQmlTimer); q->ticked(); }
 
     int interval;
     QPauseAnimationJob pause;
@@ -74,7 +74,7 @@ public:
 
 /*!
     \qmltype Timer
-    \instantiates QQuickTimer
+    \instantiates QQmlTimer
     \inqmlmodule QtQuick 2
     \ingroup qtquick-interceptors
     \brief Triggers a handler at a specified interval
@@ -112,10 +112,10 @@ public:
     \sa {declarative/toys/clocks}{Clocks example}
 */
 
-QQuickTimer::QQuickTimer(QObject *parent)
-    : QObject(*(new QQuickTimerPrivate), parent)
+QQmlTimer::QQmlTimer(QObject *parent)
+    : QObject(*(new QQmlTimerPrivate), parent)
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     d->pause.addAnimationChangeListener(d, QAbstractAnimationJob::Completion | QAbstractAnimationJob::CurrentLoop);
     d->pause.setLoopCount(1);
     d->pause.setDuration(d->interval);
@@ -128,9 +128,9 @@ QQuickTimer::QQuickTimer(QObject *parent)
 
     The default interval is 1000 milliseconds.
 */
-void QQuickTimer::setInterval(int interval)
+void QQmlTimer::setInterval(int interval)
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (interval != d->interval) {
         d->interval = interval;
         update();
@@ -138,9 +138,9 @@ void QQuickTimer::setInterval(int interval)
     }
 }
 
-int QQuickTimer::interval() const
+int QQmlTimer::interval() const
 {
-    Q_D(const QQuickTimer);
+    Q_D(const QQmlTimer);
     return d->interval;
 }
 
@@ -155,15 +155,15 @@ int QQuickTimer::interval() const
 
     \sa repeat
 */
-bool QQuickTimer::isRunning() const
+bool QQmlTimer::isRunning() const
 {
-    Q_D(const QQuickTimer);
+    Q_D(const QQmlTimer);
     return d->running;
 }
 
-void QQuickTimer::setRunning(bool running)
+void QQmlTimer::setRunning(bool running)
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (d->running != running) {
         d->running = running;
         d->firstTick = true;
@@ -183,15 +183,15 @@ void QQuickTimer::setRunning(bool running)
 
     \sa running
 */
-bool QQuickTimer::isRepeating() const
+bool QQmlTimer::isRepeating() const
 {
-    Q_D(const QQuickTimer);
+    Q_D(const QQmlTimer);
     return d->repeating;
 }
 
-void QQuickTimer::setRepeating(bool repeating)
+void QQmlTimer::setRepeating(bool repeating)
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (repeating != d->repeating) {
         d->repeating = repeating;
         update();
@@ -216,15 +216,15 @@ void QQuickTimer::setRepeating(bool repeating)
 
     \sa running
 */
-bool QQuickTimer::triggeredOnStart() const
+bool QQmlTimer::triggeredOnStart() const
 {
-    Q_D(const QQuickTimer);
+    Q_D(const QQmlTimer);
     return d->triggeredOnStart;
 }
 
-void QQuickTimer::setTriggeredOnStart(bool triggeredOnStart)
+void QQmlTimer::setTriggeredOnStart(bool triggeredOnStart)
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (d->triggeredOnStart != triggeredOnStart) {
         d->triggeredOnStart = triggeredOnStart;
         update();
@@ -239,7 +239,7 @@ void QQuickTimer::setTriggeredOnStart(bool triggeredOnStart)
     If the timer is already running, calling this method has no effect.  The
     \c running property will be true following a call to \c start().
 */
-void QQuickTimer::start()
+void QQmlTimer::start()
 {
     setRunning(true);
 }
@@ -251,7 +251,7 @@ void QQuickTimer::start()
     If the timer is not running, calling this method has no effect.  The
     \c running property will be false following a call to \c stop().
 */
-void QQuickTimer::stop()
+void QQmlTimer::stop()
 {
     setRunning(false);
 }
@@ -264,15 +264,15 @@ void QQuickTimer::stop()
     stopped, reset to initial state and started.  The \c running property
     will be true following a call to \c restart().
 */
-void QQuickTimer::restart()
+void QQmlTimer::restart()
 {
     setRunning(false);
     setRunning(true);
 }
 
-void QQuickTimer::update()
+void QQmlTimer::update()
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (d->classBegun && !d->componentComplete)
         return;
     d->pause.stop();
@@ -288,15 +288,15 @@ void QQuickTimer::update()
     }
 }
 
-void QQuickTimer::classBegin()
+void QQmlTimer::classBegin()
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     d->classBegun = true;
 }
 
-void QQuickTimer::componentComplete()
+void QQmlTimer::componentComplete()
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     d->componentComplete = true;
     update();
 }
@@ -306,17 +306,17 @@ void QQuickTimer::componentComplete()
 
     This handler is called when the Timer is triggered.
 */
-void QQuickTimer::ticked()
+void QQmlTimer::ticked()
 {
-    Q_D(QQuickTimer);
+    Q_D(QQmlTimer);
     if (d->running && (d->pause.currentTime() > 0 || (d->triggeredOnStart && d->firstTick)))
         emit triggered();
     d->firstTick = false;
 }
 
-void QQuickTimerPrivate::animationFinished(QAbstractAnimationJob *)
+void QQmlTimerPrivate::animationFinished(QAbstractAnimationJob *)
 {
-    Q_Q(QQuickTimer);
+    Q_Q(QQmlTimer);
     if (repeating || !running)
         return;
     running = false;
similarity index 91%
rename from src/quick/util/qquicktimer_p.h
rename to src/qml/qml/qqmltimer_p.h
index 91bac9e..ec9046d 100644 (file)
 **
 ****************************************************************************/
 
-#ifndef QQUICKTIMER_H
-#define QQUICKTIMER_H
+#ifndef QQMLTIMER_H
+#define QQMLTIMER_H
 
 #include <qqml.h>
 
 #include <QtCore/qobject.h>
 
-#include <private/qtquickglobal_p.h>
+#include <private/qtqmlglobal_p.h>
 
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
-class QQuickTimerPrivate;
-class Q_AUTOTEST_EXPORT QQuickTimer : public QObject, public QQmlParserStatus
+class QQmlTimerPrivate;
+class Q_AUTOTEST_EXPORT QQmlTimer : public QObject, public QQmlParserStatus
 {
     Q_OBJECT
-    Q_DECLARE_PRIVATE(QQuickTimer)
+    Q_DECLARE_PRIVATE(QQmlTimer)
     Q_INTERFACES(QQmlParserStatus)
     Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
     Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
@@ -65,7 +65,7 @@ class Q_AUTOTEST_EXPORT QQuickTimer : public QObject, public QQmlParserStatus
     Q_PROPERTY(QObject *parent READ parent CONSTANT)
 
 public:
-    QQuickTimer(QObject *parent=0);
+    QQmlTimer(QObject *parent=0);
 
     void setInterval(int interval);
     int interval() const;
@@ -104,7 +104,7 @@ private Q_SLOTS:
 
 QT_END_NAMESPACE
 
-QML_DECLARE_TYPE(QQuickTimer)
+QML_DECLARE_TYPE(QQmlTimer)
 
 QT_END_HEADER
 
index 7ecb792..0491e94 100644 (file)
@@ -43,8 +43,6 @@
 #include "qquickanimation_p.h"
 #include "qquickanimation_p_p.h"
 #include "qquickbehavior_p.h"
-#include "qquickbind_p.h"
-#include "qquickconnections_p.h"
 #include "qquicksmoothedanimation_p.h"
 #include "qquickfontloader_p.h"
 #include "qquickpackage_p.h"
@@ -55,7 +53,6 @@
 #include "qquickstate_p.h"
 #include "qquickstate_p_p.h"
 #include "qquicksystempalette_p.h"
-#include "qquicktimer_p.h"
 #include "qquicktransition_p.h"
 #include <qqmlinfo.h>
 #include <private/qqmltypenotavailable_p.h>
@@ -72,9 +69,7 @@ void QQuickUtilModule::defineModule()
     qmlRegisterUncreatableType<QQuickAbstractAnimation>("QtQuick",2,0,"Animation",QQuickAbstractAnimation::tr("Animation is an abstract class"));
 
     qmlRegisterType<QQuickBehavior>("QtQuick",2,0,"Behavior");
-    qmlRegisterType<QQuickBind>("QtQuick",2,0,"Binding");
     qmlRegisterType<QQuickColorAnimation>("QtQuick",2,0,"ColorAnimation");
-    qmlRegisterType<QQuickConnections>("QtQuick",2,0,"Connections");
     qmlRegisterType<QQuickSmoothedAnimation>("QtQuick",2,0,"SmoothedAnimation");
     qmlRegisterType<QQuickFontLoader>("QtQuick",2,0,"FontLoader");
     qmlRegisterType<QQuickNumberAnimation>("QtQuick",2,0,"NumberAnimation");
@@ -92,12 +87,10 @@ void QQuickUtilModule::defineModule()
     qmlRegisterType<QQuickStateGroup>("QtQuick",2,0,"StateGroup");
     qmlRegisterType<QQuickState>("QtQuick",2,0,"State");
     qmlRegisterType<QQuickSystemPalette>("QtQuick",2,0,"SystemPalette");
-    qmlRegisterType<QQuickTimer>("QtQuick",2,0,"Timer");
     qmlRegisterType<QQuickTransition>("QtQuick",2,0,"Transition");
     qmlRegisterType<QQuickVector3dAnimation>("QtQuick",2,0,"Vector3dAnimation");
 
     qmlRegisterType<QQuickStateOperation>();
 
     qmlRegisterCustomType<QQuickPropertyChanges>("QtQuick",2,0,"PropertyChanges", new QQuickPropertyChangesParser);
-    qmlRegisterCustomType<QQuickConnections>("QtQuick",2,0,"Connections", new QQmlConnectionsParser);
 }
index 3d93b9f..7a56a95 100644 (file)
@@ -1,7 +1,6 @@
 SOURCES += \
     $$PWD/qquickapplication.cpp\
     $$PWD/qquickutilmodule.cpp\
-    $$PWD/qquickconnections.cpp \
     $$PWD/qquickpackage.cpp \
     $$PWD/qquickanimation.cpp \
     $$PWD/qquicksystempalette.cpp \
@@ -16,8 +15,6 @@ SOURCES += \
     $$PWD/qquicktransition.cpp \
     $$PWD/qquicklistaccessor.cpp \
     $$PWD/qquicktimeline.cpp \
-    $$PWD/qquicktimer.cpp \
-    $$PWD/qquickbind.cpp \
     $$PWD/qquickpixmapcache.cpp \
     $$PWD/qquickbehavior.cpp \
     $$PWD/qquickfontloader.cpp \
@@ -34,7 +31,6 @@ SOURCES += \
 HEADERS += \
     $$PWD/qquickapplication_p.h\
     $$PWD/qquickutilmodule_p.h\
-    $$PWD/qquickconnections_p.h \
     $$PWD/qquickpackage_p.h \
     $$PWD/qquickanimation_p.h \
     $$PWD/qquickanimation_p_p.h \
@@ -52,8 +48,6 @@ HEADERS += \
     $$PWD/qquicktransition_p.h \
     $$PWD/qquicklistaccessor_p.h \
     $$PWD/qquicktimeline_p_p.h \
-    $$PWD/qquicktimer_p.h \
-    $$PWD/qquickbind_p.h \
     $$PWD/qquickpixmapcache_p.h \
     $$PWD/qquickbehavior_p.h \
     $$PWD/qquickfontloader_p.h \
index a9fa764..bbef361 100644 (file)
@@ -41,16 +41,17 @@ PRIVATETESTS += \
     qqmlsqldatabase \
     qqmlvaluetypes \
     qqmlvaluetypeproviders \
-    qquickbinding \
+    qqmlbinding \
     qquickchangeset \
-    qquickconnection \
+    qqmlconnections \
     qquicklistcompositor \
     qquicklistmodel \
     qquicklistmodelworkerscript \
     qquickworkerscript \
     qqmlbundle \
     qrcqml \
-    v4
+    v4 \
+    qqmltimer
 
 !contains(QT_CONFIG, no-widgets) {
     PUBLICTESTS += \
similarity index 79%
rename from tests/auto/qml/qquickbinding/qquickbinding.pro
rename to tests/auto/qml/qqmlbinding/qqmlbinding.pro
index e209f81..35a5f1c 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
-TARGET = tst_qquickbinding
+TARGET = tst_qqmlbinding
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickbinding.cpp
+SOURCES += tst_qqmlbinding.cpp
 
 include (../../shared/util.pri)
 
 #include <qtest.h>
 #include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlcomponent.h>
-#include <private/qquickbind_p.h>
+#include <private/qqmlbind_p.h>
 #include <QtQuick/private/qquickrectangle_p.h>
 #include "../../shared/util.h"
 
-class tst_qquickbinding : public QQmlDataTest
+class tst_qqmlbinding : public QQmlDataTest
 {
     Q_OBJECT
 public:
-    tst_qquickbinding();
+    tst_qqmlbinding();
 
 private slots:
     void binding();
@@ -63,18 +63,18 @@ private:
     QQmlEngine engine;
 };
 
-tst_qquickbinding::tst_qquickbinding()
+tst_qqmlbinding::tst_qqmlbinding()
 {
 }
 
-void tst_qquickbinding::binding()
+void tst_qqmlbinding::binding()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("test-binding.qml"));
     QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
     QVERIFY(rect != 0);
 
-    QQuickBind *binding3 = qobject_cast<QQuickBind*>(rect->findChild<QQuickBind*>("binding3"));
+    QQmlBind *binding3 = qobject_cast<QQmlBind*>(rect->findChild<QQmlBind*>("binding3"));
     QVERIFY(binding3 != 0);
 
     QCOMPARE(rect->color(), QColor("yellow"));
@@ -86,7 +86,7 @@ void tst_qquickbinding::binding()
 
     QCOMPARE(binding3->when(), true);
 
-    QQuickBind *binding = qobject_cast<QQuickBind*>(rect->findChild<QQuickBind*>("binding1"));
+    QQmlBind *binding = qobject_cast<QQmlBind*>(rect->findChild<QQmlBind*>("binding1"));
     QVERIFY(binding != 0);
     QCOMPARE(binding->object(), qobject_cast<QObject*>(rect));
     QCOMPARE(binding->property(), QLatin1String("text"));
@@ -95,7 +95,7 @@ void tst_qquickbinding::binding()
     delete rect;
 }
 
-void tst_qquickbinding::whenAfterValue()
+void tst_qqmlbinding::whenAfterValue()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("test-binding2.qml"));
@@ -111,7 +111,7 @@ void tst_qquickbinding::whenAfterValue()
     delete rect;
 }
 
-void tst_qquickbinding::restoreBinding()
+void tst_qqmlbinding::restoreBinding()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("restoreBinding.qml"));
@@ -141,7 +141,7 @@ void tst_qquickbinding::restoreBinding()
     delete rect;
 }
 
-void tst_qquickbinding::restoreBindingWithLoop()
+void tst_qqmlbinding::restoreBindingWithLoop()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("restoreBindingWithLoop.qml"));
@@ -177,7 +177,7 @@ void tst_qquickbinding::restoreBindingWithLoop()
     delete rect;
 }
 
-void tst_qquickbinding::restoreBindingWithoutCrash()
+void tst_qqmlbinding::restoreBindingWithoutCrash()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("restoreBindingWithoutCrash.qml"));
@@ -217,7 +217,7 @@ void tst_qquickbinding::restoreBindingWithoutCrash()
 }
 
 //QTBUG-20692
-void tst_qquickbinding::deletedObject()
+void tst_qqmlbinding::deletedObject()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("deletedObject.qml"));
@@ -232,6 +232,6 @@ void tst_qquickbinding::deletedObject()
     delete rect;
 }
 
-QTEST_MAIN(tst_qquickbinding)
+QTEST_MAIN(tst_qqmlbinding)
 
-#include "tst_qquickbinding.moc"
+#include "tst_qqmlbinding.moc"
diff --git a/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-ignored.qml b/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-ignored.qml
new file mode 100644 (file)
index 0000000..0780dd1
--- /dev/null
@@ -0,0 +1,8 @@
+import QtQml 2.0
+
+QtObject {
+    id: root
+
+    property Connections c1: Connections { target: root; onNotFooBar1: {} ignoreUnknownSignals: true }
+    property Connections c2: Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
+}
diff --git a/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-notarget.qml b/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-notarget.qml
new file mode 100644 (file)
index 0000000..3da3e0f
--- /dev/null
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+    property Connections c1: Connections { objectName: "connections"; target: null; onNotFooBar: {} }
+}
diff --git a/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-parent.qml b/tests/auto/qml/qqmlconnections/data/connection-unknownsignals-parent.qml
new file mode 100644 (file)
index 0000000..2c55215
--- /dev/null
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+    property Connections c1: Connections { objectName: "connections"; onFooBar: {} }
+}
diff --git a/tests/auto/qml/qqmlconnections/data/connection-unknownsignals.qml b/tests/auto/qml/qqmlconnections/data/connection-unknownsignals.qml
new file mode 100644 (file)
index 0000000..a351016
--- /dev/null
@@ -0,0 +1,7 @@
+import QtQml 2.0
+
+QtObject {
+    id: screen
+
+    property Connections c1: Connections { objectName: "connections"; target: screen; onFooBar: {} }
+}
diff --git a/tests/auto/qml/qqmlconnections/data/error-object.qml b/tests/auto/qml/qqmlconnections/data/error-object.qml
new file mode 100644 (file)
index 0000000..8594811
--- /dev/null
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+Connections {
+    onClicked: Timer {}
+}
diff --git a/tests/auto/qml/qqmlconnections/data/error-property.qml b/tests/auto/qml/qqmlconnections/data/error-property.qml
new file mode 100644 (file)
index 0000000..b08a4a5
--- /dev/null
@@ -0,0 +1,3 @@
+import QtQml 2.0
+
+Connections { fakeProperty: {} }
diff --git a/tests/auto/qml/qqmlconnections/data/error-property2.qml b/tests/auto/qml/qqmlconnections/data/error-property2.qml
new file mode 100644 (file)
index 0000000..fcfbf5b
--- /dev/null
@@ -0,0 +1,3 @@
+import QtQml 2.0
+
+Connections { onfakeProperty: {} }
diff --git a/tests/auto/qml/qqmlconnections/data/error-syntax.qml b/tests/auto/qml/qqmlconnections/data/error-syntax.qml
new file mode 100644 (file)
index 0000000..62c841b
--- /dev/null
@@ -0,0 +1,7 @@
+import QtQml 2.0
+
+Connections {
+    onClicked {
+        onPressed: {}
+    }
+}
@@ -1,7 +1,7 @@
-import QtQuick 2.0
+import QtQml 2.0
 import MyTestSingletonType 1.0 as MyTestSingletonType
 
-Item {
+QtObject {
     id: rootObject
     objectName: "rootObject"
     property int newIntPropValue: 12
@@ -14,7 +14,7 @@ Item {
         newIntPropValue = newIntPropValue + 1;
     }
 
-    Connections {
+    property Connections c: Connections {
         target: MyTestSingletonType.Api
         onIntPropChanged: moduleIntPropChangedCount = moduleIntPropChangedCount + 1;
         onOtherSignal: moduleOtherSignalCount = moduleOtherSignalCount + 1;
diff --git a/tests/auto/qml/qqmlconnections/data/test-connection3.qml b/tests/auto/qml/qqmlconnections/data/test-connection3.qml
new file mode 100644 (file)
index 0000000..9aaca22
--- /dev/null
@@ -0,0 +1,3 @@
+import QtQml 2.0
+
+Connections {}
diff --git a/tests/auto/qml/qqmlconnections/data/trimming.qml b/tests/auto/qml/qqmlconnections/data/trimming.qml
new file mode 100644 (file)
index 0000000..4c37eb2
--- /dev/null
@@ -0,0 +1,10 @@
+import QtQml 2.0
+
+QtObject {
+    id: root
+
+    property string tested
+    signal testMe(int param1, string param2)
+
+    property Connections c: Connections { target: root; onTestMe: root.tested = param2 + param1 }
+}
@@ -1,8 +1,8 @@
 CONFIG += testcase
-TARGET = tst_qquickconnection
+TARGET = tst_qqmlconnections
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquickconnection.cpp
+SOURCES += tst_qqmlconnections.cpp
 
 include (../../shared/util.pri)
 
 #include <qtest.h>
 #include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlcomponent.h>
-#include <private/qquickconnections_p.h>
+#include <private/qqmlconnections_p.h>
 #include <private/qquickitem_p.h>
 #include "../../shared/util.h"
 #include <QtQml/qqmlscriptstring.h>
 
-class tst_qquickconnection : public QQmlDataTest
+class tst_qqmlconnections : public QQmlDataTest
 {
     Q_OBJECT
 public:
-    tst_qquickconnection();
+    tst_qqmlconnections();
 
 private slots:
     void defaultValues();
@@ -69,15 +69,15 @@ private:
     QQmlEngine engine;
 };
 
-tst_qquickconnection::tst_qquickconnection()
+tst_qqmlconnections::tst_qqmlconnections()
 {
 }
 
-void tst_qquickconnection::defaultValues()
+void tst_qqmlconnections::defaultValues()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("test-connection3.qml"));
-    QQuickConnections *item = qobject_cast<QQuickConnections*>(c.create());
+    QQmlConnections *item = qobject_cast<QQmlConnections*>(c.create());
 
     QVERIFY(item != 0);
     QVERIFY(item->target() == 0);
@@ -85,11 +85,11 @@ void tst_qquickconnection::defaultValues()
     delete item;
 }
 
-void tst_qquickconnection::properties()
+void tst_qqmlconnections::properties()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("test-connection2.qml"));
-    QQuickConnections *item = qobject_cast<QQuickConnections*>(c.create());
+    QQmlConnections *item = qobject_cast<QQmlConnections*>(c.create());
 
     QVERIFY(item != 0);
 
@@ -99,7 +99,7 @@ void tst_qquickconnection::properties()
     delete item;
 }
 
-void tst_qquickconnection::connection()
+void tst_qqmlconnections::connection()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("test-connection.qml"));
@@ -116,35 +116,35 @@ void tst_qquickconnection::connection()
     delete item;
 }
 
-void tst_qquickconnection::trimming()
+void tst_qqmlconnections::trimming()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("trimming.qml"));
-    QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
+    QObject *object = c.create();
 
-    QVERIFY(item != 0);
+    QVERIFY(object != 0);
 
-    QCOMPARE(item->property("tested").toString(), QString(""));
-    int index = item->metaObject()->indexOfSignal("testMe(int,QString)");
-    QMetaMethod method = item->metaObject()->method(index);
-    method.invoke(item,
+    QCOMPARE(object->property("tested").toString(), QString(""));
+    int index = object->metaObject()->indexOfSignal("testMe(int,QString)");
+    QMetaMethod method = object->metaObject()->method(index);
+    method.invoke(object,
                   Qt::DirectConnection,
                   Q_ARG(int, 5),
                   Q_ARG(QString, "worked"));
-    QCOMPARE(item->property("tested").toString(), QString("worked5"));
+    QCOMPARE(object->property("tested").toString(), QString("worked5"));
 
-    delete item;
+    delete object;
 }
 
 // Confirm that target can be changed by one of our signal handlers
-void tst_qquickconnection::targetChanged()
+void tst_qqmlconnections::targetChanged()
 {
     QQmlEngine engine;
     QQmlComponent c(&engine, testFileUrl("connection-targetchange.qml"));
     QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
     QVERIFY(item != 0);
 
-    QQuickConnections *connections = item->findChild<QQuickConnections*>("connections");
+    QQmlConnections *connections = item->findChild<QQmlConnections*>("connections");
     QVERIFY(connections);
 
     QQuickItem *item1 = item->findChild<QQuickItem*>("item1");
@@ -161,18 +161,18 @@ void tst_qquickconnection::targetChanged()
     delete item;
 }
 
-void tst_qquickconnection::unknownSignals_data()
+void tst_qqmlconnections::unknownSignals_data()
 {
     QTest::addColumn<QString>("file");
     QTest::addColumn<QString>("error");
 
-    QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
-    QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+    QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:30: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+    QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":4:30: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
     QTest::newRow("ignored") << "connection-unknownsignals-ignored.qml" << ""; // should be NO error
     QTest::newRow("notarget") << "connection-unknownsignals-notarget.qml" << ""; // should be NO error
 }
 
-void tst_qquickconnection::unknownSignals()
+void tst_qqmlconnections::unknownSignals()
 {
     QFETCH(QString, file);
     QFETCH(QString, error);
@@ -186,20 +186,20 @@ void tst_qquickconnection::unknownSignals()
 
     QQmlEngine engine;
     QQmlComponent c(&engine, url);
-    QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
-    QVERIFY(item != 0);
+    QObject *object = c.create();
+    QVERIFY(object != 0);
 
     // check that connection is created (they are all runtime errors)
-    QQuickConnections *connections = item->findChild<QQuickConnections*>("connections");
+    QQmlConnections *connections = object->findChild<QQmlConnections*>("connections");
     QVERIFY(connections);
 
     if (file == "connection-unknownsignals-ignored.qml")
         QVERIFY(connections->ignoreUnknownSignals());
 
-    delete item;
+    delete object;
 }
 
-void tst_qquickconnection::errors_data()
+void tst_qqmlconnections::errors_data()
 {
     QTest::addColumn<QString>("file");
     QTest::addColumn<QString>("error");
@@ -210,7 +210,7 @@ void tst_qquickconnection::errors_data()
     QTest::newRow("grouped object") << "error-syntax.qml" << "Connections: syntax error";
 }
 
-void tst_qquickconnection::errors()
+void tst_qqmlconnections::errors()
 {
     QFETCH(QString, file);
     QFETCH(QString, error);
@@ -245,7 +245,7 @@ private:
     bool m_ran;
 };
 
-void tst_qquickconnection::rewriteErrors()
+void tst_qqmlconnections::rewriteErrors()
 {
     qmlRegisterType<TestObject>("Test", 1, 0, "TestObject");
     {
@@ -312,7 +312,7 @@ static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine)
 }
 
 // QTBUG-20937
-void tst_qquickconnection::singletonTypeTarget()
+void tst_qqmlconnections::singletonTypeTarget()
 {
     qmlRegisterSingletonType<MyTestSingletonType>("MyTestSingletonType", 1, 0, "Api", module_api_factory);
     QQmlComponent component(&engine, testFileUrl("singletontype-target.qml"));
@@ -338,6 +338,6 @@ void tst_qquickconnection::singletonTypeTarget()
     delete object;
 }
 
-QTEST_MAIN(tst_qquickconnection)
+QTEST_MAIN(tst_qqmlconnections)
 
-#include "tst_qquickconnection.moc"
+#include "tst_qqmlconnections.moc"
index 7a4fe5e..26018b5 100644 (file)
@@ -2,4 +2,7 @@ import QtQml 2.0
 
 QtObject {
     property Component c
+    property Timer timer
+    property Connections connections: Connections {}
+    property Binding binding
 }
index 937a8b1..128294b 100644 (file)
@@ -593,7 +593,7 @@ void tst_qqmlengine::qtqmlModule_data()
             << QString(testFileUrl("qtqmlModule.4.qml").toString() + QLatin1String(":1 module \"QtQml\" version 2.5 is not installed\n"))
             << QStringList();
 
-    QTest::newRow("QtQml 2.0 module provides Component and QtObject")
+    QTest::newRow("QtQml 2.0 module provides Component, QtObject, Connections, Binding and Timer")
             << testFileUrl("qtqmlModule.5.qml")
             << QString()
             << QStringList();
similarity index 76%
rename from tests/auto/quick/qquicktimer/qquicktimer.pro
rename to tests/auto/qml/qqmltimer/qqmltimer.pro
index 60f862a..28f8e69 100644 (file)
@@ -1,8 +1,8 @@
 CONFIG += testcase
-TARGET = tst_qquicktimer
+TARGET = tst_qqmltimer
 macx:CONFIG -= app_bundle
 
-SOURCES += tst_qquicktimer.cpp
+SOURCES += tst_qqmltimer.cpp
 
 CONFIG += parallel_test
 QT += core-private gui-private qml-private quick-private gui testlib
 #include <qtest.h>
 #include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlcomponent.h>
-#include <QtQuick/private/qquicktimer_p.h>
+#include <QtQml/private/qqmltimer_p.h>
 #include <QtQuick/qquickitem.h>
 #include <QDebug>
 
-class tst_qquicktimer : public QObject
+class tst_qqmltimer : public QObject
 {
     Q_OBJECT
 public:
-    tst_qquicktimer();
+    tst_qqmltimer();
 
 private slots:
     void notRepeating();
@@ -84,16 +84,16 @@ public slots:
 
 #define TIMEOUT_TIMEOUT 200
 
-tst_qquicktimer::tst_qquicktimer()
+tst_qqmltimer::tst_qqmltimer()
 {
 }
 
-void tst_qquicktimer::notRepeating()
+void tst_qqmltimer::notRepeating()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
     component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
     QVERIFY(timer->isRunning());
     QVERIFY(!timer->isRepeating());
@@ -109,12 +109,12 @@ void tst_qquicktimer::notRepeating()
     QVERIFY(timer->isRunning() == false);
 }
 
-void tst_qquicktimer::notRepeatingStart()
+void tst_qqmltimer::notRepeatingStart()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
     QVERIFY(!timer->isRunning());
 
@@ -134,12 +134,12 @@ void tst_qquicktimer::notRepeatingStart()
     delete timer;
 }
 
-void tst_qquicktimer::repeat()
+void tst_qqmltimer::repeat()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -176,12 +176,12 @@ void tst_qquicktimer::repeat()
     delete timer;
 }
 
-void tst_qquicktimer::triggeredOnStart()
+void tst_qqmltimer::triggeredOnStart()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
     QVERIFY(timer->triggeredOnStart());
 
@@ -211,12 +211,12 @@ void tst_qquicktimer::triggeredOnStart()
     delete timer;
 }
 
-void tst_qquicktimer::triggeredOnStartRepeat()
+void tst_qqmltimer::triggeredOnStartRepeat()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -234,15 +234,15 @@ void tst_qquicktimer::triggeredOnStartRepeat()
     delete timer;
 }
 
-void tst_qquicktimer::noTriggerIfNotRunning()
+void tst_qqmltimer::noTriggerIfNotRunning()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
     component.setData(QByteArray(
-        "import QtQuick 2.0\n"
-        "Item { property bool ok: true\n"
-            "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
-            "Timer { interval: 10; running: true; onTriggered: t1.running=false }"
+        "import QtQml 2.0\n"
+        "QtObject { property bool ok: true\n"
+            "property Timer timer1: Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
+            "property Timer timer2: Timer { interval: 10; running: true; onTriggered: t1.running=false }"
         "}"
     ), QUrl::fromLocalFile(""));
     QObject *item = component.create();
@@ -253,12 +253,12 @@ void tst_qquicktimer::noTriggerIfNotRunning()
     delete item;
 }
 
-void tst_qquicktimer::changeDuration()
+void tst_qqmltimer::changeDuration()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -289,12 +289,12 @@ void tst_qquicktimer::changeDuration()
     delete timer;
 }
 
-void tst_qquicktimer::restart()
+void tst_qqmltimer::restart()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(component.create());
+    component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -316,18 +316,18 @@ void tst_qquicktimer::restart()
     delete timer;
 }
 
-void tst_qquicktimer::restartFromTriggered()
+void tst_qqmltimer::restartFromTriggered()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { "
+    component.setData(QByteArray("import QtQml 2.0\nTimer { "
                                     "interval: 500; "
                                     "repeat: false; "
                                     "running: true; "
                                     "onTriggered: restart()"
                                  " }"), QUrl::fromLocalFile(""));
     QScopedPointer<QObject> object(component.create());
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(object.data());
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(object.data());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -343,11 +343,11 @@ void tst_qquicktimer::restartFromTriggered()
     QVERIFY(timer->isRunning());
 }
 
-void tst_qquicktimer::runningFromTriggered()
+void tst_qqmltimer::runningFromTriggered()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
-    component.setData(QByteArray("import QtQuick 2.0\nTimer { "
+    component.setData(QByteArray("import QtQml 2.0\nTimer { "
                                     "property bool ok: false; "
                                     "interval: 500; "
                                     "repeat: false; "
@@ -355,7 +355,7 @@ void tst_qquicktimer::runningFromTriggered()
                                     "onTriggered: { ok = !running; running = true }"
                                  " }"), QUrl::fromLocalFile(""));
     QScopedPointer<QObject> object(component.create());
-    QQuickTimer *timer = qobject_cast<QQuickTimer*>(object.data());
+    QQmlTimer *timer = qobject_cast<QQmlTimer*>(object.data());
     QVERIFY(timer != 0);
 
     TimerHelper helper;
@@ -373,14 +373,14 @@ void tst_qquicktimer::runningFromTriggered()
     QVERIFY(timer->isRunning());
 }
 
-void tst_qquicktimer::parentProperty()
+void tst_qqmltimer::parentProperty()
 {
     QQmlEngine engine;
     QQmlComponent component(&engine);
     component.setData(QByteArray("import QtQuick 2.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
     QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
     QVERIFY(item != 0);
-    QQuickTimer *timer = item->findChild<QQuickTimer*>("timer");
+    QQmlTimer *timer = item->findChild<QQmlTimer*>("timer");
     QVERIFY(timer != 0);
 
     QVERIFY(timer->isRunning());
@@ -388,6 +388,6 @@ void tst_qquicktimer::parentProperty()
     delete timer;
 }
 
-QTEST_MAIN(tst_qquicktimer)
+QTEST_MAIN(tst_qqmltimer)
 
-#include "tst_qquicktimer.moc"
+#include "tst_qqmltimer.moc"
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml
deleted file mode 100644 (file)
index 05d06bd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    id: screen
-
-    Connections { target: screen; onNotFooBar1: {} ignoreUnknownSignals: true }
-    Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
-}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml
deleted file mode 100644 (file)
index 9d25cba..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    id: screen
-
-    Connections { objectName: "connections"; target: null; onNotFooBar: {} }
-}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml
deleted file mode 100644 (file)
index bcd2812..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    id: screen
-
-    Connections { objectName: "connections"; onFooBar: {} }
-}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml
deleted file mode 100644 (file)
index ad8d4d9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    id: screen
-
-    Connections { objectName: "connections"; target: screen; onFooBar: {} }
-}
diff --git a/tests/auto/qml/qquickconnection/data/error-object.qml b/tests/auto/qml/qquickconnection/data/error-object.qml
deleted file mode 100644 (file)
index 256b262..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    Connections {
-        onClicked: Item {}
-    }
-}
diff --git a/tests/auto/qml/qquickconnection/data/error-property.qml b/tests/auto/qml/qquickconnection/data/error-property.qml
deleted file mode 100644 (file)
index a602479..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    Connections { fakeProperty: {} }
-}
diff --git a/tests/auto/qml/qquickconnection/data/error-property2.qml b/tests/auto/qml/qquickconnection/data/error-property2.qml
deleted file mode 100644 (file)
index 8123afe..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    Connections { onfakeProperty: {} }
-}
diff --git a/tests/auto/qml/qquickconnection/data/error-syntax.qml b/tests/auto/qml/qquickconnection/data/error-syntax.qml
deleted file mode 100644 (file)
index 16c0534..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    Connections {
-        onClicked {
-            onPressed: {}
-        }
-    }
-}
diff --git a/tests/auto/qml/qquickconnection/data/test-connection3.qml b/tests/auto/qml/qquickconnection/data/test-connection3.qml
deleted file mode 100644 (file)
index 9e88f0f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-import QtQuick 2.0
-
-Connections {}
diff --git a/tests/auto/qml/qquickconnection/data/trimming.qml b/tests/auto/qml/qquickconnection/data/trimming.qml
deleted file mode 100644 (file)
index 6692050..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-import QtQuick 2.0
-
-Item {
-    id: screen; width: 50
-
-    property string tested
-    signal testMe(int param1, string param2)
-
-    Connections { target: screen; onTestMe: screen.tested = param2 + param1 }
-}
index abc5e7a..5f18fc9 100644 (file)
@@ -25,7 +25,6 @@ PRIVATETESTS += \
     qquickstyledtext \
     qquickstates \
     qquicksystempalette \
-    qquicktimer \
     qquickxmllistmodel
 
 # This test requires the xmlpatterns module