From 0ae469c1bbe2f5fa033b88116546b293a8bdf565 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 25 Mar 2010 15:24:52 +1000 Subject: Rename qdeclarativetime -> qmltime Consistent with "qml" runtime binary --- tests/benchmarks/declarative/declarative.pro | 2 +- .../declarative/qdeclarativetime/example.qml | 14 -- .../qdeclarativetime/qdeclarativetime.cpp | 231 --------------------- .../qdeclarativetime/qdeclarativetime.pro | 23 -- .../qdeclarativetime/tests/anchors/empty.qml | 34 --- .../qdeclarativetime/tests/anchors/fill.qml | 41 ---- .../qdeclarativetime/tests/anchors/null.qml | 27 --- .../qdeclarativetime/tests/animation/large.qml | 41 ---- .../tests/animation/largeNoProps.qml | 41 ---- .../tests/item_creation/children.qml | 34 --- .../qdeclarativetime/tests/item_creation/data.qml | 34 --- .../tests/item_creation/no_creation.qml | 12 -- .../tests/item_creation/resources.qml | 34 --- .../qdeclarativetime/tests/loader/Loaded.qml | 7 - .../tests/loader/component_loader.qml | 16 -- .../qdeclarativetime/tests/loader/empty_loader.qml | 15 -- .../qdeclarativetime/tests/loader/no_loader.qml | 14 -- .../tests/loader/source_loader.qml | 16 -- .../tests/positioner_creation/no_positioner.qml | 37 ---- .../tests/positioner_creation/null_positioner.qml | 34 --- .../tests/positioner_creation/positioner.qml | 37 ---- tests/benchmarks/declarative/qmltime/example.qml | 14 ++ tests/benchmarks/declarative/qmltime/qmltime.cpp | 231 +++++++++++++++++++++ tests/benchmarks/declarative/qmltime/qmltime.pro | 23 ++ .../declarative/qmltime/tests/anchors/empty.qml | 34 +++ .../declarative/qmltime/tests/anchors/fill.qml | 41 ++++ .../declarative/qmltime/tests/anchors/null.qml | 27 +++ .../declarative/qmltime/tests/animation/large.qml | 41 ++++ .../qmltime/tests/animation/largeNoProps.qml | 41 ++++ .../qmltime/tests/item_creation/children.qml | 34 +++ .../qmltime/tests/item_creation/data.qml | 34 +++ .../qmltime/tests/item_creation/no_creation.qml | 12 ++ .../qmltime/tests/item_creation/resources.qml | 34 +++ .../declarative/qmltime/tests/loader/Loaded.qml | 7 + .../qmltime/tests/loader/component_loader.qml | 16 ++ .../qmltime/tests/loader/empty_loader.qml | 15 ++ .../declarative/qmltime/tests/loader/no_loader.qml | 14 ++ .../qmltime/tests/loader/source_loader.qml | 16 ++ .../tests/positioner_creation/no_positioner.qml | 37 ++++ .../tests/positioner_creation/null_positioner.qml | 34 +++ .../tests/positioner_creation/positioner.qml | 37 ++++ 41 files changed, 743 insertions(+), 743 deletions(-) delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/example.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/animation/large.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/animation/largeNoProps.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/loader/Loaded.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/loader/component_loader.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/loader/empty_loader.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/loader/no_loader.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/loader/source_loader.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml create mode 100644 tests/benchmarks/declarative/qmltime/example.qml create mode 100644 tests/benchmarks/declarative/qmltime/qmltime.cpp create mode 100644 tests/benchmarks/declarative/qmltime/qmltime.pro create mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/null.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/animation/large.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml create mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index 38ea6c4..a7d426c 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -8,4 +8,4 @@ SUBDIRS += \ qdeclarativeimage \ qdeclarativemetaproperty \ script \ - qdeclarativetime + qmltime diff --git a/tests/benchmarks/declarative/qdeclarativetime/example.qml b/tests/benchmarks/declarative/qdeclarativetime/example.qml deleted file mode 100644 index dd6185d..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/example.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - property string name: "Bob Smith" - - QDeclarativeTime.Timer { - component: Item { - Text { text: name } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp deleted file mode 100644 index 20f0d93d..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, 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. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include - -class Timer : public QObject -{ - Q_OBJECT - Q_PROPERTY(QDeclarativeComponent *component READ component WRITE setComponent); - -public: - Timer(); - - QDeclarativeComponent *component() const; - void setComponent(QDeclarativeComponent *); - - static Timer *timerInstance(); - - void run(uint); - - bool willParent() const; - void setWillParent(bool p); - -private: - void runTest(QDeclarativeContext *, uint); - - QDeclarativeComponent *m_component; - static Timer *m_timer; - - bool m_willparent; - QGraphicsScene m_scene; - QGraphicsRectItem m_item; -}; -QML_DECLARE_TYPE(Timer); - -Timer *Timer::m_timer = 0; - -Timer::Timer() -: m_component(0), m_willparent(false) -{ - if (m_timer) - qWarning("Timer: Timer already registered"); - m_timer = this; - - m_scene.setItemIndexMethod(QGraphicsScene::NoIndex); - m_scene.addItem(&m_item); -} - -QDeclarativeComponent *Timer::component() const -{ - return m_component; -} - -void Timer::setComponent(QDeclarativeComponent *c) -{ - m_component = c; -} - -Timer *Timer::timerInstance() -{ - return m_timer; -} - -void Timer::run(uint iterations) -{ - QDeclarativeContext context(qmlContext(this)); - - QObject *o = m_component->create(&context); - QGraphicsObject *go = qobject_cast(o); - if (m_willparent && go) - go->setParentItem(&m_item); - delete o; - - runTest(&context, iterations); -} - -bool Timer::willParent() const -{ - return m_willparent; -} - -void Timer::setWillParent(bool p) -{ - m_willparent = p; -} - -void Timer::runTest(QDeclarativeContext *context, uint iterations) -{ - QTime t; - t.start(); - for (uint ii = 0; ii < iterations; ++ii) { - QObject *o = m_component->create(context); - QGraphicsObject *go = qobject_cast(o); - if (m_willparent && go) - go->setParentItem(&m_item); - delete o; - } - - int e = t.elapsed(); - - qWarning() << "Total:" << e << "ms, Per iteration:" << qreal(e) / qreal(iterations) << "ms"; - -} - -void usage(const char *name) -{ - qWarning("Usage: %s [-iterations ] [-parent] ", name); - exit(-1); -} - -int main(int argc, char ** argv) -{ - QApplication app(argc, argv); - - qmlRegisterType("QDeclarativeTime", 1, 0, "Timer"); - - uint iterations = 1024; - QString filename; - bool willParent = false; - - for (int ii = 1; ii < argc; ++ii) { - QByteArray arg(argv[ii]); - - if (arg == "-iterations") { - if (ii + 1 < argc) { - ++ii; - QByteArray its(argv[ii]); - bool ok = false; - iterations = its.toUInt(&ok); - if (!ok) - usage(argv[0]); - } else { - usage(argv[0]); - } - } else if (arg == "-parent") { - willParent = true; - } else { - filename = QLatin1String(argv[ii]); - } - } - - if (filename.isEmpty()) -#ifdef Q_OS_SYMBIAN - filename = QLatin1String("./tests/item_creation/data.qml"); -#else - usage(argv[0]); -#endif - - QDeclarativeEngine engine; - QDeclarativeComponent component(&engine, filename); - if (component.isError()) { - qWarning() << component.errors(); - return -1; - } - - QObject *obj = component.create(); - if (!obj) { - qWarning() << component.errors(); - return -1; - } - - Timer *timer = Timer::timerInstance(); - if (!timer) { - qWarning() << "A Tester.Timer instance is required."; - return -1; - } - -#ifdef Q_OS_SYMBIAN - willParent = true; -#endif - timer->setWillParent(willParent); - - if (!timer->component()) { - qWarning() << "The timer has no component"; - return -1; - } - -#ifdef Q_OS_SYMBIAN - iterations = 1024; -#endif - - timer->run(iterations); - - return 0; -} - -#include "qdeclarativetime.moc" diff --git a/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro b/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro deleted file mode 100644 index 7902ee1..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/qdeclarativetime.pro +++ /dev/null @@ -1,23 +0,0 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = qdeclarativetime -QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += qdeclarativetime.cpp - -symbian* { - TARGET.CAPABILITY = "All -TCB" - example.sources = example.qml - esample.path = . - tests.sources = tests/* - tests.path = tests - anshors.sources = tests/anchors/* - anchors.path = tests/anchors - item_creation.sources = tests/item_creation/* - item_creation.path = tests/item_creation - positioner_creation.sources = tests/positioner_creation/* - positioner_creation.path = tests/positioner_creation - DEPLOYMENT += example tests anchors item_creation positioner_creation -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml deleted file mode 100644 index 8d93594..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/empty.qml +++ /dev/null @@ -1,34 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - Item { - anchors.leftMargin: 0 - } - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml deleted file mode 100644 index 918c48a..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/fill.qml +++ /dev/null @@ -1,41 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - Item { - anchors.fill: parent - anchors.leftMargin: 0 - } - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml deleted file mode 100644 index bb84538..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/anchors/null.qml +++ /dev/null @@ -1,27 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Item { - } - Item { - } - Item { - } - Item { - } - Item { - } - Item { - } - Item { - } - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/animation/large.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/animation/large.qml deleted file mode 100644 index 978e3bf..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/animation/large.qml +++ /dev/null @@ -1,41 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - ParallelAnimation { - NumberAnimation { duration: 500 } - NumberAnimation { duration: 4000; } - NumberAnimation { duration: 2000; easing.type: "OutBack"} - ColorAnimation { duration: 3000} - SequentialAnimation { - PauseAnimation { duration: 1000 } - ScriptAction { script: doSomething(); } - PauseAnimation { duration: 800 } - ScriptAction { script: doSomethingElse(); } - PauseAnimation { duration: 800 } - ParallelAnimation { - NumberAnimation { duration: 200;} - SequentialAnimation { - PauseAnimation { duration: 200} - ParallelAnimation { - NumberAnimation { duration: 300;} - NumberAnimation { duration: 300;} - } - NumberAnimation { from: 0; to: 1; duration: 500 } - PauseAnimation { duration: 200 } - NumberAnimation { from: 1; to: 0; duration: 500 } - } - SequentialAnimation { - PauseAnimation { duration: 150} - NumberAnimation { duration: 300; easing.type: "OutBounce" } - } - } - } - } - } - } - -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/animation/largeNoProps.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/animation/largeNoProps.qml deleted file mode 100644 index cceb3f4..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/animation/largeNoProps.qml +++ /dev/null @@ -1,41 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - ParallelAnimation { - NumberAnimation { } - NumberAnimation { } - NumberAnimation { } - ColorAnimation { } - SequentialAnimation { - PauseAnimation { } - ScriptAction { } - PauseAnimation { } - ScriptAction { } - PauseAnimation { } - ParallelAnimation { - NumberAnimation { } - SequentialAnimation { - PauseAnimation { } - ParallelAnimation { - NumberAnimation { } - NumberAnimation { } - } - NumberAnimation { } - PauseAnimation { } - NumberAnimation { } - } - SequentialAnimation { - PauseAnimation { } - NumberAnimation { } - } - } - } - } - } - } - -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml deleted file mode 100644 index 3387a32..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/children.qml +++ /dev/null @@ -1,34 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - children: [ - Rectangle { }, - Rectangle { }, - Item { }, - Image { }, - Text { }, - Item { }, - Item { }, - Image { }, - Image { }, - Row { }, - Image { }, - Image { }, - Column { }, - Row { }, - Text { }, - Text { }, - Text { }, - MouseArea { } - ] - - } - } - } - -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml deleted file mode 100644 index a8b653c..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/data.qml +++ /dev/null @@ -1,34 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - data: [ - Rectangle { }, - Rectangle { }, - Item { }, - Image { }, - Text { }, - Item { }, - Item { }, - Image { }, - Image { }, - Row { }, - Image { }, - Image { }, - Column { }, - Row { }, - Text { }, - Text { }, - Text { }, - MouseArea { } - ] - - } - } - } - -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml deleted file mode 100644 index 0a507d4..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/no_creation.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - } - } - } -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml deleted file mode 100644 index 227d8ad..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/item_creation/resources.qml +++ /dev/null @@ -1,34 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - resources: [ - Rectangle { }, - Rectangle { }, - Item { }, - Image { }, - Text { }, - Item { }, - Item { }, - Image { }, - Image { }, - Row { }, - Image { }, - Image { }, - Column { }, - Row { }, - Text { }, - Text { }, - Text { }, - MouseArea { } - ] - - } - } - } - -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/Loaded.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/loader/Loaded.qml deleted file mode 100644 index 6f8d849..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/Loaded.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt 4.6 - -Item { - Rectangle {} - Text {} - Image {} -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/component_loader.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/loader/component_loader.qml deleted file mode 100644 index 270add4..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/component_loader.qml +++ /dev/null @@ -1,16 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Loader { - sourceComponent: Loaded {} - } - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/empty_loader.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/loader/empty_loader.qml deleted file mode 100644 index d3b84cc..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/empty_loader.qml +++ /dev/null @@ -1,15 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Loader {} - Loaded {} - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/no_loader.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/loader/no_loader.qml deleted file mode 100644 index a94a12a..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/no_loader.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Loaded {} - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/source_loader.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/loader/source_loader.qml deleted file mode 100644 index 39ed1a6..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/loader/source_loader.qml +++ /dev/null @@ -1,16 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - - QDeclarativeTime.Timer { - component: Component { - Item { - Loader { - source: "Loaded.qml" - } - } - } - } -} - diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml deleted file mode 100644 index c1f54a4..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/no_positioner.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - QDeclarativeTime.Timer { - component: Component { - Item { - Rectangle { } - Rectangle { } - Item { - Image { } - Text { } - } - - Item { - Item { - Image { } - Image { } - Item { - Image { } - Image { } - } - } - - Item { - Item { - Text { } - Text { } - } - Text { } - } - } - MouseArea { } - } - } - } -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml deleted file mode 100644 index d49ff78..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/null_positioner.qml +++ /dev/null @@ -1,34 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - QDeclarativeTime.Timer { - component: Component { - Item { - Rectangle { } - Rectangle { } - Item { - Image { } - Text { } - } - - Item { - Item { - Image { } - Image { } - Row { } - Image { } - Image { } - } - - Column { } - Row { } - Text { } - Text { } - Text { } - } - MouseArea { } - } - } - } -} diff --git a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml deleted file mode 100644 index 05ca804..0000000 --- a/tests/benchmarks/declarative/qdeclarativetime/tests/positioner_creation/positioner.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.6 -import QDeclarativeTime 1.0 as QDeclarativeTime - -Item { - QDeclarativeTime.Timer { - component: Component { - Item { - Rectangle { } - Rectangle { } - Item { - Image { } - Text { } - } - - Item { - Item { - Image { } - Image { } - Row { - Image { } - Image { } - } - } - - Column { - Row { - Text { } - Text { } - } - Text { } - } - } - MouseArea { } - } - } - } -} diff --git a/tests/benchmarks/declarative/qmltime/example.qml b/tests/benchmarks/declarative/qmltime/example.qml new file mode 100644 index 0000000..68889f0 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/example.qml @@ -0,0 +1,14 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + property string name: "Bob Smith" + + QmlTime.Timer { + component: Item { + Text { text: name } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/qmltime.cpp b/tests/benchmarks/declarative/qmltime/qmltime.cpp new file mode 100644 index 0000000..3932e01 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/qmltime.cpp @@ -0,0 +1,231 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +class Timer : public QObject +{ + Q_OBJECT + Q_PROPERTY(QDeclarativeComponent *component READ component WRITE setComponent); + +public: + Timer(); + + QDeclarativeComponent *component() const; + void setComponent(QDeclarativeComponent *); + + static Timer *timerInstance(); + + void run(uint); + + bool willParent() const; + void setWillParent(bool p); + +private: + void runTest(QDeclarativeContext *, uint); + + QDeclarativeComponent *m_component; + static Timer *m_timer; + + bool m_willparent; + QGraphicsScene m_scene; + QGraphicsRectItem m_item; +}; +QML_DECLARE_TYPE(Timer); + +Timer *Timer::m_timer = 0; + +Timer::Timer() +: m_component(0), m_willparent(false) +{ + if (m_timer) + qWarning("Timer: Timer already registered"); + m_timer = this; + + m_scene.setItemIndexMethod(QGraphicsScene::NoIndex); + m_scene.addItem(&m_item); +} + +QDeclarativeComponent *Timer::component() const +{ + return m_component; +} + +void Timer::setComponent(QDeclarativeComponent *c) +{ + m_component = c; +} + +Timer *Timer::timerInstance() +{ + return m_timer; +} + +void Timer::run(uint iterations) +{ + QDeclarativeContext context(qmlContext(this)); + + QObject *o = m_component->create(&context); + QGraphicsObject *go = qobject_cast(o); + if (m_willparent && go) + go->setParentItem(&m_item); + delete o; + + runTest(&context, iterations); +} + +bool Timer::willParent() const +{ + return m_willparent; +} + +void Timer::setWillParent(bool p) +{ + m_willparent = p; +} + +void Timer::runTest(QDeclarativeContext *context, uint iterations) +{ + QTime t; + t.start(); + for (uint ii = 0; ii < iterations; ++ii) { + QObject *o = m_component->create(context); + QGraphicsObject *go = qobject_cast(o); + if (m_willparent && go) + go->setParentItem(&m_item); + delete o; + } + + int e = t.elapsed(); + + qWarning() << "Total:" << e << "ms, Per iteration:" << qreal(e) / qreal(iterations) << "ms"; + +} + +void usage(const char *name) +{ + qWarning("Usage: %s [-iterations ] [-parent] ", name); + exit(-1); +} + +int main(int argc, char ** argv) +{ + QApplication app(argc, argv); + + qmlRegisterType("QmlTime", 1, 0, "Timer"); + + uint iterations = 1024; + QString filename; + bool willParent = false; + + for (int ii = 1; ii < argc; ++ii) { + QByteArray arg(argv[ii]); + + if (arg == "-iterations") { + if (ii + 1 < argc) { + ++ii; + QByteArray its(argv[ii]); + bool ok = false; + iterations = its.toUInt(&ok); + if (!ok) + usage(argv[0]); + } else { + usage(argv[0]); + } + } else if (arg == "-parent") { + willParent = true; + } else { + filename = QLatin1String(argv[ii]); + } + } + + if (filename.isEmpty()) +#ifdef Q_OS_SYMBIAN + filename = QLatin1String("./tests/item_creation/data.qml"); +#else + usage(argv[0]); +#endif + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, filename); + if (component.isError()) { + qWarning() << component.errors(); + return -1; + } + + QObject *obj = component.create(); + if (!obj) { + qWarning() << component.errors(); + return -1; + } + + Timer *timer = Timer::timerInstance(); + if (!timer) { + qWarning() << "A Tester.Timer instance is required."; + return -1; + } + +#ifdef Q_OS_SYMBIAN + willParent = true; +#endif + timer->setWillParent(willParent); + + if (!timer->component()) { + qWarning() << "The timer has no component"; + return -1; + } + +#ifdef Q_OS_SYMBIAN + iterations = 1024; +#endif + + timer->run(iterations); + + return 0; +} + +#include "qmltime.moc" diff --git a/tests/benchmarks/declarative/qmltime/qmltime.pro b/tests/benchmarks/declarative/qmltime/qmltime.pro new file mode 100644 index 0000000..9352f3b --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/qmltime.pro @@ -0,0 +1,23 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = qmltime +QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += qmltime.cpp + +symbian* { + TARGET.CAPABILITY = "All -TCB" + example.sources = example.qml + esample.path = . + tests.sources = tests/* + tests.path = tests + anshors.sources = tests/anchors/* + anchors.path = tests/anchors + item_creation.sources = tests/item_creation/* + item_creation.path = tests/item_creation + positioner_creation.sources = tests/positioner_creation/* + positioner_creation.path = tests/positioner_creation + DEPLOYMENT += example tests anchors item_creation positioner_creation +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml new file mode 100644 index 0000000..31c879b --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml @@ -0,0 +1,34 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + Item { + anchors.leftMargin: 0 + } + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml new file mode 100644 index 0000000..23fe78e --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml @@ -0,0 +1,41 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + Item { + anchors.fill: parent + anchors.leftMargin: 0 + } + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml new file mode 100644 index 0000000..bc447ef --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml @@ -0,0 +1,27 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Item { + } + Item { + } + Item { + } + Item { + } + Item { + } + Item { + } + Item { + } + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/large.qml b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml new file mode 100644 index 0000000..c1cdb68 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml @@ -0,0 +1,41 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + ParallelAnimation { + NumberAnimation { duration: 500 } + NumberAnimation { duration: 4000; } + NumberAnimation { duration: 2000; easing.type: "OutBack"} + ColorAnimation { duration: 3000} + SequentialAnimation { + PauseAnimation { duration: 1000 } + ScriptAction { script: doSomething(); } + PauseAnimation { duration: 800 } + ScriptAction { script: doSomethingElse(); } + PauseAnimation { duration: 800 } + ParallelAnimation { + NumberAnimation { duration: 200;} + SequentialAnimation { + PauseAnimation { duration: 200} + ParallelAnimation { + NumberAnimation { duration: 300;} + NumberAnimation { duration: 300;} + } + NumberAnimation { from: 0; to: 1; duration: 500 } + PauseAnimation { duration: 200 } + NumberAnimation { from: 1; to: 0; duration: 500 } + } + SequentialAnimation { + PauseAnimation { duration: 150} + NumberAnimation { duration: 300; easing.type: "OutBounce" } + } + } + } + } + } + } + +} diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml new file mode 100644 index 0000000..3db9f08 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml @@ -0,0 +1,41 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + ParallelAnimation { + NumberAnimation { } + NumberAnimation { } + NumberAnimation { } + ColorAnimation { } + SequentialAnimation { + PauseAnimation { } + ScriptAction { } + PauseAnimation { } + ScriptAction { } + PauseAnimation { } + ParallelAnimation { + NumberAnimation { } + SequentialAnimation { + PauseAnimation { } + ParallelAnimation { + NumberAnimation { } + NumberAnimation { } + } + NumberAnimation { } + PauseAnimation { } + NumberAnimation { } + } + SequentialAnimation { + PauseAnimation { } + NumberAnimation { } + } + } + } + } + } + } + +} diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml new file mode 100644 index 0000000..996602c --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml @@ -0,0 +1,34 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + children: [ + Rectangle { }, + Rectangle { }, + Item { }, + Image { }, + Text { }, + Item { }, + Item { }, + Image { }, + Image { }, + Row { }, + Image { }, + Image { }, + Column { }, + Row { }, + Text { }, + Text { }, + Text { }, + MouseArea { } + ] + + } + } + } + +} diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml new file mode 100644 index 0000000..9f79c34 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml @@ -0,0 +1,34 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + data: [ + Rectangle { }, + Rectangle { }, + Item { }, + Image { }, + Text { }, + Item { }, + Item { }, + Image { }, + Image { }, + Row { }, + Image { }, + Image { }, + Column { }, + Row { }, + Text { }, + Text { }, + Text { }, + MouseArea { } + ] + + } + } + } + +} diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml new file mode 100644 index 0000000..f228c2a --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml @@ -0,0 +1,12 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + } + } + } +} diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml new file mode 100644 index 0000000..335aeb8 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml @@ -0,0 +1,34 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + resources: [ + Rectangle { }, + Rectangle { }, + Item { }, + Image { }, + Text { }, + Item { }, + Item { }, + Image { }, + Image { }, + Row { }, + Image { }, + Image { }, + Column { }, + Row { }, + Text { }, + Text { }, + Text { }, + MouseArea { } + ] + + } + } + } + +} diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml new file mode 100644 index 0000000..6f8d849 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Item { + Rectangle {} + Text {} + Image {} +} diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml new file mode 100644 index 0000000..65d5010 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml @@ -0,0 +1,16 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Loader { + sourceComponent: Loaded {} + } + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml new file mode 100644 index 0000000..2dfe922 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml @@ -0,0 +1,15 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Loader {} + Loaded {} + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml new file mode 100644 index 0000000..1fa0d3b --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml @@ -0,0 +1,14 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Loaded {} + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml new file mode 100644 index 0000000..33bb91c --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml @@ -0,0 +1,16 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + + QmlTime.Timer { + component: Component { + Item { + Loader { + source: "Loaded.qml" + } + } + } + } +} + diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml new file mode 100644 index 0000000..97bad47 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml @@ -0,0 +1,37 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + QmlTime.Timer { + component: Component { + Item { + Rectangle { } + Rectangle { } + Item { + Image { } + Text { } + } + + Item { + Item { + Image { } + Image { } + Item { + Image { } + Image { } + } + } + + Item { + Item { + Text { } + Text { } + } + Text { } + } + } + MouseArea { } + } + } + } +} diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml new file mode 100644 index 0000000..36dda15 --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml @@ -0,0 +1,34 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + QmlTime.Timer { + component: Component { + Item { + Rectangle { } + Rectangle { } + Item { + Image { } + Text { } + } + + Item { + Item { + Image { } + Image { } + Row { } + Image { } + Image { } + } + + Column { } + Row { } + Text { } + Text { } + Text { } + } + MouseArea { } + } + } + } +} diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml new file mode 100644 index 0000000..396e27d --- /dev/null +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml @@ -0,0 +1,37 @@ +import Qt 4.6 +import QmlTime 1.0 as QmlTime + +Item { + QmlTime.Timer { + component: Component { + Item { + Rectangle { } + Rectangle { } + Item { + Image { } + Text { } + } + + Item { + Item { + Image { } + Image { } + Row { + Image { } + Image { } + } + } + + Column { + Row { + Text { } + Text { } + } + Text { } + } + } + MouseArea { } + } + } + } +} -- cgit v0.12