summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-25 23:01:37 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-25 23:01:37 (GMT)
commit93f0f38085e8fe2657ef3d7c5e24576d4475e85d (patch)
tree1e0d6ab6445732f24186f86114d237bea6b5cde3
parent9797617e80469c79da096d6013e233d7d75de87a (diff)
downloadQt-93f0f38085e8fe2657ef3d7c5e24576d4475e85d.zip
Qt-93f0f38085e8fe2657ef3d7c5e24576d4475e85d.tar.gz
Qt-93f0f38085e8fe2657ef3d7c5e24576d4475e85d.tar.bz2
Test cleanup.
-rw-r--r--tests/benchmarks/qfxview/main.cpp182
-rw-r--r--tests/benchmarks/qfxview/qfxview.pro16
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/editor/data.xml44
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/background.pngbin26508 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/background3.pngbin37671 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/battery.pngbin770 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar-blur.pngbin51439 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar.pngbin10153 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory-blur.pngbin57023 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory.pngbin13227 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/camera-blur.pngbin50955 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/camera.pngbin16126 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts-blur.pngbin51041 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts.pngbin12177 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager-blur.pngbin45164 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager.pngbin8858 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/fire.pngbin1124 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-blue.pngbin764 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-container.pngbin536 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-front.pngbin962 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-pink.pngbin747 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-yellow.pngbin775 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/ice.pngbin1112 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/icon-reflection.pngbin7123 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/internet-blur.pngbin57126 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/internet.pngbin24320 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-background1.pngbin2831 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border1.pngbin926 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border3.pngbin10153 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-highlight.pngbin3421 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/menubar.pngbin741 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/messages-blur.pngbin44556 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/messages.pngbin11426 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/moon.pngbin1027 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/sad.pngbin1053 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/settings-blur.pngbin50199 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/settings.pngbin8697 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/signal.pngbin739 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/smile.pngbin1051 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/star.pngbin262 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/sun.pngbin1021 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/titlebar.pngbin1041 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/pics/wifi.pngbin782 -> 0 bytes
-rw-r--r--tests/benchmarks/qfxview/testdata/tatwheel/tat-wheel.xml68
-rw-r--r--tests/benchmarks/qmlpainting/qmlpainting.pro5
-rw-r--r--tests/benchmarks/qmlpainting/tst_qmlpainting.cpp696
-rw-r--r--tests/benchmarks/qmlxmlparser/main.cpp96
-rw-r--r--tests/benchmarks/qmlxmlparser/qmlxmlparser.pro14
-rw-r--r--tests/benchmarks/qmlxmlparser/testdata/concept2.xml421
49 files changed, 701 insertions, 841 deletions
diff --git a/tests/benchmarks/qfxview/main.cpp b/tests/benchmarks/qfxview/main.cpp
deleted file mode 100644
index 787b113..0000000
--- a/tests/benchmarks/qfxview/main.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-#include <QFxView>
-#include <QmlBindContext>
-#include <QtGui>
-#include <QTest>
-#include <gfxtimeline.h>
-
-class tst_qfxview : public QObject
-{
- Q_OBJECT
-
-private slots:
- void render();
- void render_data();
-
-private:
- void waitForUpdates(QObject* obj, int howmany, int timeout = 10000);
- bool eventFilter(QObject*, QEvent*);
-
- QString testdata(QString const&);
- QString readFile(QString const&);
-
- int m_updateCount;
- QEventLoop* m_eventLoop;
- int m_updateLimit;
-};
-
-bool tst_qfxview::eventFilter(QObject*, QEvent* e)
-{
- if (!m_eventLoop) {
- return false;
- }
-
- if (e->type() == QEvent::UpdateRequest) {
- m_updateCount++;
- if (m_updateCount >= m_updateLimit) {
- m_eventLoop->quit();
- }
- }
-
- return false;
-}
-
-void tst_qfxview::waitForUpdates(QObject* obj, int howmany, int timeout)
-{
- m_updateLimit = howmany;
- m_updateCount = 0;
-
- QEventLoop loop;
- m_eventLoop = &loop;
- if (timeout > 0)
- QTimer::singleShot(timeout, &loop, SLOT(quit()));
-
- obj->installEventFilter(this);
- loop.exec();
- obj->removeEventFilter(this);
-
- m_eventLoop = 0;
-
- if (m_updateCount < howmany) {
- QFAIL(qPrintable(
- QString("Didn't receive %1 updates within %2 milliseconds (only got %3)")
- .arg(howmany).arg(timeout).arg(m_updateCount)
- ));
- }
-}
-
-void tst_qfxview::render()
-{
- QFETCH(QString, xml);
- QFETCH(QString, filename);
- QFETCH(int, mode);
-
- static const int FRAMES = 100;
-
- QPixmap pm(800, 600);
-
- QFxView view((QSimpleCanvas::CanvasMode)mode);
- view.setFixedSize(pm.size());
- if (!filename.isEmpty()) {
- filename = testdata(filename);
- xml = readFile(filename);
- }
- view.setXml(xml, filename);
- QFileInfo fi(filename);
- view.setPath(fi.path());
-
- /* So we can reuse duiviewer examples... */
- QObject *dummyData = QML::newInstance(fi.path() + "/editor/data.xml");
- if (dummyData) {
- QmlBindContext *ctxt = view.bindContext();
- ctxt->setProperty("obj", dummyData);
- ctxt->addDefaultObject(dummyData);
- dummyData->setParent(&view);
- }
-
- view.show();
- view.raise();
- QTest::qWait(100);
- view.activateWindow();
- QTest::qWait(100);
- QVERIFY(view.isActiveWindow());
-
- view.execute();
-
- /* Set internal GfxAppClock to consistent timing (every tick is 5 ms) */
- {
- GfxTimeLine tl;
- tl.setMode(GfxTimeLine::Consistent);
- }
-
- /* Render FRAMES amount of updates */
- QBENCHMARK {
- waitForUpdates(&view, FRAMES);
- if (QTest::currentTestFailed()) return;
- }
-
- //view.dumpTiming();
-}
-
-void tst_qfxview::render_data()
-{
- QTest::addColumn<QString> ("xml");
- QTest::addColumn<QString> ("filename");
- QTest::addColumn<int> ("mode");
-
- QTest::newRow("tatwheel-simplecanvas")
- << QString()
- << QString("tatwheel/tat-wheel.xml")
- << int(QSimpleCanvas::SimpleCanvas)
- ;
-
- QTest::newRow("tatwheel-graphicsview")
- << QString()
- << QString("tatwheel/tat-wheel.xml")
- << int(QSimpleCanvas::GraphicsView)
- ;
-
-}
-
-QString tst_qfxview::readFile(QString const& filename)
-{
- QFile file(filename);
- if (!file.open(QIODevice::ReadOnly)) {
- qFatal("Could not open %s: %s", qPrintable(filename), qPrintable(file.errorString()));
- }
- QByteArray ba = file.readAll();
- return QString::fromLatin1(ba);
-}
-
-QString tst_qfxview::testdata(QString const& name)
-{
-#define _STR(X) #X
-#define STR(X) _STR(X)
- return QString("%1/testdata/%2").arg(STR(SRCDIR)).arg(name);
-}
-
-int main(int argc, char** argv)
-{
- /* Remove this when -graphicssystem raster is the default. */
- bool explicit_graphicssystem = false;
-
- QVector<const char*> args;
- for (int i = 0; i < argc; ++i) {
- if (!strcmp(argv[i], "-graphicssystem"))
- explicit_graphicssystem = true;
- args << argv[i];
- }
-
- if (!explicit_graphicssystem) {
- args << "-graphicssystem" << "raster";
- }
-
- argc = args.count();
- argv = const_cast<char**>(args.data());
-
- QApplication app(argc, argv);
-
- tst_qfxview test;
- return QTest::qExec(&test, argc, argv);
-}
-
-#include "main.moc"
diff --git a/tests/benchmarks/qfxview/qfxview.pro b/tests/benchmarks/qfxview/qfxview.pro
deleted file mode 100644
index e7dd168..0000000
--- a/tests/benchmarks/qfxview/qfxview.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-load(qttest_p4)
-TEMPLATE = app
-TARGET = tst_qfxview
-DEPENDPATH += .
-INCLUDEPATH += .
-
-CONFIG += release
-
-QT += declarative script
-
-DEFINES+=SRCDIR=\"$$PWD\"
-
-# Input
-SOURCES += \
- main.cpp
-
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/editor/data.xml b/tests/benchmarks/qfxview/testdata/tatwheel/editor/data.xml
deleted file mode 100644
index 0a28d4f..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/editor/data.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<Object>
- <properties>
- <Property name="appModel">
- <ListModel>
- <App>
- <name>Internet</name>
- <icon>pics/internet</icon>
- </App>
- <App>
- <name>Calendar</name>
- <icon>pics/calendar</icon>
- </App>
- <App>
- <name>Contacts</name>
- <icon>pics/contacts</icon>
- </App>
- <App>
- <name>Camera</name>
- <icon>pics/camera</icon>
- </App>
- <App>
- <name>Messages</name>
- <icon>pics/messages</icon>
- </App>
- <App>
- <name>Call history</name>
- <icon>pics/callhistory</icon>
- </App>
- <App>
- <name>File manager</name>
- <icon>pics/file-manager</icon>
- </App>
- <App>
- <name>Settings</name>
- <icon>pics/settings</icon>
- </App>
- <App>
- <name>Call history</name>
- <icon>pics/callhistory</icon>
- </App>
- </ListModel>
- </Property>
- </properties>
-</Object>
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/background.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/background.png
deleted file mode 100644
index 4b6f56e..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/background.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/background3.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/background3.png
deleted file mode 100644
index 66cb522..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/background3.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/battery.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/battery.png
deleted file mode 100644
index 4bd03d4..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/battery.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar-blur.png
deleted file mode 100644
index 136ae80..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar.png
deleted file mode 100644
index 0e63f1c..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/calendar.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory-blur.png
deleted file mode 100644
index 5ed1c99..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory.png
deleted file mode 100644
index 6c26405..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/callhistory.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera-blur.png
deleted file mode 100644
index 7285278..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera.png
deleted file mode 100644
index 710907f..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/camera.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts-blur.png
deleted file mode 100644
index 5ba94c7..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts.png
deleted file mode 100644
index 78bb885..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/contacts.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager-blur.png
deleted file mode 100644
index 6ec1d55..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager.png
deleted file mode 100644
index e58a39b..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/file-manager.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/fire.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/fire.png
deleted file mode 100644
index e1b40cf..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/fire.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-blue.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-blue.png
deleted file mode 100644
index 3cb05ef..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-blue.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-container.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-container.png
deleted file mode 100644
index dd34cbd..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-container.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-front.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-front.png
deleted file mode 100644
index bed9e60..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-front.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-pink.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-pink.png
deleted file mode 100644
index b84ee88..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-pink.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-yellow.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-yellow.png
deleted file mode 100644
index 4108ea3..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/flask-yellow.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/ice.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/ice.png
deleted file mode 100644
index 8191fbc..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/ice.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/icon-reflection.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/icon-reflection.png
deleted file mode 100644
index 6c19e71..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/icon-reflection.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet-blur.png
deleted file mode 100644
index 32dc564..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet.png
deleted file mode 100644
index 820ce34..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/internet.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-background1.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-background1.png
deleted file mode 100644
index e84dc11..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-background1.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border1.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border1.png
deleted file mode 100644
index e6dea40..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border1.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border3.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border3.png
deleted file mode 100644
index 1d8a571..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-border3.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-highlight.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-highlight.png
deleted file mode 100644
index 3817b08..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menu-highlight.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menubar.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/menubar.png
deleted file mode 100644
index 1b0380a..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/menubar.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages-blur.png
deleted file mode 100644
index 3c62d53..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages.png
deleted file mode 100644
index a452d58..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/messages.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/moon.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/moon.png
deleted file mode 100644
index cc3a3bc..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/moon.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/sad.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/sad.png
deleted file mode 100644
index de90bc4..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/sad.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings-blur.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings-blur.png
deleted file mode 100644
index f175161..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings-blur.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings.png
deleted file mode 100644
index 6e72796..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/settings.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/signal.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/signal.png
deleted file mode 100644
index 7af4c24..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/signal.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/smile.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/smile.png
deleted file mode 100644
index f6bf09f..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/smile.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/star.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/star.png
deleted file mode 100644
index defbde5..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/star.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/sun.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/sun.png
deleted file mode 100644
index b2092f1..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/sun.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/titlebar.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/titlebar.png
deleted file mode 100644
index 40484d0..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/titlebar.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/pics/wifi.png b/tests/benchmarks/qfxview/testdata/tatwheel/pics/wifi.png
deleted file mode 100644
index ada1d3b..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/pics/wifi.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qfxview/testdata/tatwheel/tat-wheel.xml b/tests/benchmarks/qfxview/testdata/tatwheel/tat-wheel.xml
deleted file mode 100644
index 6da6608..0000000
--- a/tests/benchmarks/qfxview/testdata/tatwheel/tat-wheel.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<Item id="Page" width="800" height="600">
- <resources>
- <Component id="AppDelegate">
- <Item id="Wrapper" x="0" width="204" height="204" scale="{PathView.scale}" z="{PathView.z}">
- <Item width="{AppIcon.width}" height="{AppIcon.height}" anchors.horizontalCenter="{parent.horizontalCenter}" >
- <BlendedImage id="AppIcon" width="240" height="240" primaryFile="{icon + '.png'}" secondaryFile="{icon + '-blur.png'}" anchors.horizontalCenter="{parent.horizontalCenter}" blend="{1 - Wrapper.PathView.opacity}" />
- </Item>
- <Text id="AppName" anchors.top="{Wrapper.bottom}" anchors.topMargin="25"
- anchors.horizontalCenter="{parent.horizontalCenter}" text="{name}" font.bold="true" font.size="26" color="white"/>
- <states>
- <State name="HideName" when="{index != pathView.currentIndex}">
- <SetProperty target="{AppName}" property="opacity" value="0"/>
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation properties="opacity" duration="500"/>
- </Transition>
- </transitions>
- </Item>
- </Component>
- </resources>
-
- <Image id="Background" opaque="true" file="pics/background.png" anchors.fill="{parent}"/>
-
- <Item y="0" id="Wheel">
- <Script>
- <![CDATA[
- function prevItem() {
- if (Applications.currentIndex > 0)
- Applications.currentIndex--;
- else
- Applications.currentIndex = Applications.count - 1;
- }
- function nextItem() {
- if (Applications.currentIndex < Applications.count - 1)
- Applications.currentIndex++;
- else
- Applications.currentIndex = 0;
- }
- ]]>
- </Script>
- <PathView id="Applications" model="{appModel}" width="800" height="600" delegate="{AppDelegate}" focusable="true">
- <path>
- <Path startX="320" startY="350">
- <PathAttribute name="scale" value="1.0"/>
- <PathAttribute name="z" value="50"/>
- <PathAttribute name="opacity" value="1"/>
- <PathQuad x="320" y="150" controlX="740" controlY="250" />
- <PathAttribute name="scale" value="0.1"/>
- <PathAttribute name="z" value="0"/>
- <PathAttribute name="opacity" value="-0.5"/>
- <PathQuad x="320" y="350" controlX="-100" controlY="250"/>
- </Path>
- </path>
- <currentIndex>
- <SerialAnimation running="true" repeat="true">
- <NumericAnimation target="{Applications}" from="0" to="{Applications.count}" duration="1000" />
- </SerialAnimation>
- </currentIndex>
- </PathView>
- <transitions>
- <Transition>
- <NumericAnimation properties="x,y,scale,opacity" duration="250"/>
- </Transition>
- </transitions>
- </Item>
-</Item>
diff --git a/tests/benchmarks/qmlpainting/qmlpainting.pro b/tests/benchmarks/qmlpainting/qmlpainting.pro
new file mode 100644
index 0000000..58e9775
--- /dev/null
+++ b/tests/benchmarks/qmlpainting/qmlpainting.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qmlpainting
+
+SOURCES += tst_qmlpainting.cpp
diff --git a/tests/benchmarks/qmlpainting/tst_qmlpainting.cpp b/tests/benchmarks/qmlpainting/tst_qmlpainting.cpp
new file mode 100644
index 0000000..ae6f9a3
--- /dev/null
+++ b/tests/benchmarks/qmlpainting/tst_qmlpainting.cpp
@@ -0,0 +1,696 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QPainter>
+#include <QImage>
+
+#include <math.h>
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+class tst_QmlPainting : public QObject
+{
+ Q_OBJECT
+
+ public:
+ tst_QmlPainting() {}
+
+private slots:
+ void drawRoundedRect();
+ void drawScaledRoundedRect();
+ void drawTransformedRoundedRect();
+ void drawAntialiasedRoundedRect();
+ void drawScaledAntialiasedRoundedRect_data();
+ void drawScaledAntialiasedRoundedRect();
+ void drawTransformedAntialiasedRoundedRect_data();
+ void drawTransformedAntialiasedRoundedRect();
+ void drawImageRoundedRect();
+ void drawScaledImageRoundedRect_data();
+ void drawScaledImageRoundedRect();
+ void drawTransformedImageRoundedRect_data();
+ void drawTransformedImageRoundedRect();
+ void drawScaleGridRoundedRect();
+ void drawScaledScaleGridRoundedRect_data();
+ void drawScaledScaleGridRoundedRect();
+ void drawTransformedScaleGridRoundedRect_data();
+ void drawTransformedScaleGridRoundedRect();
+ void drawTransformedTransparentImage_data();
+ void drawTransformedTransparentImage();
+ void drawTransformedSemiTransparentImage_data();
+ void drawTransformedSemiTransparentImage();
+ void drawTransformedFilledImage_data();
+ void drawTransformedFilledImage();
+};
+
+const qreal inv_dist_to_plane = 1. / 1024.;
+QTransform transformForAngle(qreal angle)
+{
+ QTransform transform;
+
+ QTransform rotTrans;
+ rotTrans.translate(-40, 0);
+ QTransform rotTrans2;
+ rotTrans2.translate(40, 0);
+
+ qreal rad = angle * 2. * M_PI / 360.;
+ qreal c = ::cos(rad);
+ qreal s = ::sin(rad);
+
+ qreal x = 0;
+ qreal y = 80;
+ qreal z = 0;
+
+ qreal len = x * x + y * y + z * z;
+ if (len != 1.) {
+ len = ::sqrt(len);
+ x /= len;
+ y /= len;
+ z /= len;
+ }
+
+ QTransform rot(x*x*(1-c)+c, x*y*(1-c)-z*s, x*z*(1-c)+y*s*inv_dist_to_plane,
+ y*x*(1-c)+z*s, y*y*(1-c)+c, y*z*(1-c)-x*s*inv_dist_to_plane,
+ 0, 0, 1);
+
+ transform *= rotTrans;
+ transform *= rot;
+ transform *= rotTrans2;
+
+ return transform;
+}
+
+void tst_QmlPainting::drawRoundedRect()
+{
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.drawRoundedRect(QRectF(.5, .5, 80, 80), 10, 10);
+ }
+ surface.save("regular.png");
+}
+
+void tst_QmlPainting::drawScaledRoundedRect()
+{
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+ p.scale(3, 3);
+
+ QBENCHMARK {
+ p.drawRoundedRect(10, 10, 80, 80, 10, 10);
+ }
+ surface.save("scaled.png");
+}
+
+void tst_QmlPainting::drawTransformedRoundedRect()
+{
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawRoundedRect(100, 100, 80, 80, 10, 10);
+ }
+ surface.save("transformed.png");
+}
+
+void tst_QmlPainting::drawAntialiasedRoundedRect()
+{
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.drawRoundedRect(QRectF(.5, .5, 80, 80), 10, 10);
+ }
+ surface.save("aar.png");
+}
+
+void tst_QmlPainting::drawScaledAntialiasedRoundedRect_data()
+{
+ QTest::addColumn<float>("scale");
+
+ for (float i = 0; i < 3; i += .1)
+ QTest::newRow(QString(QLatin1String("scale=%1")).arg(i).toLatin1()) << i;
+}
+
+void tst_QmlPainting::drawScaledAntialiasedRoundedRect()
+{
+ QFETCH(float, scale);
+
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+ p.scale(scale, scale);
+
+ QBENCHMARK {
+ p.drawRoundedRect(10, 10, 80, 80, 10, 10);
+ }
+ surface.save("aas.png");
+}
+
+void tst_QmlPainting::drawTransformedAntialiasedRoundedRect_data()
+{
+ QTest::addColumn<QTransform>("transform");
+
+ for (float angle = 0; angle < 360; angle += 10)
+ QTest::newRow(QString(QLatin1String("angle=%1")).arg(angle).toLatin1()) << transformForAngle(angle);
+}
+
+void tst_QmlPainting::drawTransformedAntialiasedRoundedRect()
+{
+ QFETCH(QTransform, transform);
+
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(QPen(Qt::black, 1));
+ p.setBrush(Qt::red);
+
+ QBENCHMARK {
+ p.setWorldTransform(transform);
+ p.drawRoundedRect(100, 100, 80, 80, 10, 10);
+ }
+ surface.save("aat.png");
+}
+
+void tst_QmlPainting::drawImageRoundedRect()
+{
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, QImage::Format_ARGB32_Premultiplied);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.drawImage(0,0, rectImage);
+ }
+ surface.save("ri.png");
+}
+
+void tst_QmlPainting::drawScaledImageRoundedRect_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QmlPainting::drawScaledImageRoundedRect()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+ p.scale(3, 3);
+
+ QBENCHMARK {
+ p.drawImage(0,0, rectImage);
+ }
+ surface.save("si.png");
+}
+
+void tst_QmlPainting::drawTransformedImageRoundedRect_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QmlPainting::drawTransformedImageRoundedRect()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ const int radius = 10;
+ QImage rectImage(81, 81, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ rp.drawRoundedRect(QRectF(.5, .5, 80, 80), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(100,100, rectImage);
+ }
+ surface.save("ti.png");
+}
+
+//code from QFxRect for drawing rounded rects
+void tst_QmlPainting::drawScaleGridRoundedRect()
+{
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+
+ //setup surface
+ QImage surface(100, 100, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ const int pw = 2;
+ int offset = int(radius+1.5+pw);
+ int width = 80;
+ int height = 80;
+
+ int w = width+pw;
+ int h = height+pw;
+ int xOffset = offset;
+ int xSide = xOffset * 2;
+ bool xMiddles=true;
+ if (xSide > w) {
+ xMiddles=false;
+ xOffset = w/2 + 1;
+ xSide = xOffset * 2;
+ }
+ int yOffset = offset;
+ int ySide = yOffset * 2;
+ bool yMiddles=true;
+ if (ySide > h) {
+ yMiddles = false;
+ yOffset = h/2 + 1;
+ ySide = yOffset * 2;
+ }
+
+ // Upper left
+ p.drawImage(QRect(-pw/2, -pw/2, xOffset, yOffset), rectImage, QRect(0, 0, xOffset, yOffset));
+
+ // Upper middle
+ if (xMiddles)
+ p.drawImage(QRect(xOffset-pw/2, -pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, 0, 1, yOffset));
+ // Upper right
+ p.drawImage(QPoint(width-xOffset+pw/2, -pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, 0, xOffset, yOffset));
+ // Middle left
+ if (yMiddles)
+ p.drawImage(QRect(-pw/2, yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(0, rectImage.height()/2, xOffset, 1));
+
+ // Middle
+ if (xMiddles && yMiddles)
+ p.drawImage(QRect(xOffset-pw/2, yOffset-pw/2, width - xSide + pw, height - ySide + pw), rectImage,
+ QRect(rectImage.width()/2, rectImage.height()/2, 1, 1));
+ // Middle right
+ if (yMiddles)
+ p.drawImage(QRect(width-xOffset+pw/2, yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height()/2, xOffset, 1));
+ // Lower left
+ p.drawImage(QPoint(-pw/2, height - yOffset + pw/2), rectImage, QRect(0, rectImage.height() - yOffset, xOffset, yOffset));
+
+ // Lower Middle
+ if (xMiddles)
+ p.drawImage(QRect(xOffset-pw/2, height - yOffset +pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, rectImage.height() - yOffset, 1, yOffset));
+ // Lower Right
+ p.drawImage(QPoint(width-xOffset+pw/2, height - yOffset+pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height() - yOffset, xOffset, yOffset));
+ }
+ surface.save("rsg.png");
+}
+
+void tst_QmlPainting::drawScaledScaleGridRoundedRect_data()
+{
+ QTest::addColumn<float>("scale");
+ QTest::addColumn<int>("imageType");
+
+ for (float i = 0; i < 3; i += .1)
+ QTest::newRow(QString(QLatin1String("scale=%1; imagetype=ARGB32_Pre")).arg(i).toLatin1()) << i << (int)QImage::Format_ARGB32_Premultiplied;
+ //for (float i = 0; i < 3; i += .1)
+ // QTest::newRow(QString(QLatin1String("scale=%1; imagetype=ARGB8565_Pre")).arg(i).toLatin1()) << i << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+//code from QFxRect for drawing rounded rects
+void tst_QmlPainting::drawScaledScaleGridRoundedRect()
+{
+ QFETCH(float, scale);
+ QFETCH(int, imageType);
+
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+ p.scale(scale, scale);
+
+ QBENCHMARK {
+ const int pw = 2;
+ int offset = int(radius+1.5+pw);
+ int width = 80;
+ int height = 80;
+
+ int w = width+pw;
+ int h = height+pw;
+ int xOffset = offset;
+ int xSide = xOffset * 2;
+ bool xMiddles=true;
+ if (xSide > w) {
+ xMiddles=false;
+ xOffset = w/2 + 1;
+ xSide = xOffset * 2;
+ }
+ int yOffset = offset;
+ int ySide = yOffset * 2;
+ bool yMiddles=true;
+ if (ySide > h) {
+ yMiddles = false;
+ yOffset = h/2 + 1;
+ ySide = yOffset * 2;
+ }
+
+ // Upper left
+ p.drawImage(QRect(10-pw/2, 10-pw/2, xOffset, yOffset), rectImage, QRect(0, 0, xOffset, yOffset));
+
+ // Upper middle
+ if (xMiddles)
+ p.drawImage(QRect(10+xOffset-pw/2, 10+-pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, 0, 1, yOffset));
+ // Upper right
+ p.drawImage(QPoint(10+width-xOffset+pw/2, 10+-pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, 0, xOffset, yOffset));
+ // Middle left
+ if (yMiddles)
+ p.drawImage(QRect(10+-pw/2, 10+yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(0, rectImage.height()/2, xOffset, 1));
+
+ // Middle
+ if (xMiddles && yMiddles)
+ p.drawImage(QRect(10+xOffset-pw/2, 10+yOffset-pw/2, width - xSide + pw, height - ySide + pw), rectImage,
+ QRect(rectImage.width()/2, rectImage.height()/2, 1, 1));
+ // Middle right
+ if (yMiddles)
+ p.drawImage(QRect(10+width-xOffset+pw/2, 10+yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height()/2, xOffset, 1));
+ // Lower left
+ p.drawImage(QPoint(10+-pw/2, 10+height - yOffset + pw/2), rectImage, QRect(0, rectImage.height() - yOffset, xOffset, yOffset));
+
+ // Lower Middle
+ if (xMiddles)
+ p.drawImage(QRect(10+xOffset-pw/2, 10+height - yOffset +pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, rectImage.height() - yOffset, 1, yOffset));
+ // Lower Right
+ p.drawImage(QPoint(10+width-xOffset+pw/2, 10+height - yOffset+pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height() - yOffset, xOffset, yOffset));
+ }
+ surface.save("ssg.png");
+}
+
+void tst_QmlPainting::drawTransformedScaleGridRoundedRect_data()
+{
+ QTest::addColumn<QTransform>("transform");
+ QTest::addColumn<int>("imageType");
+
+ for (float angle = 0; angle < 360; angle += 10)
+ QTest::newRow(QString(QLatin1String("angle=%1; imagetype=ARGB32_Pre")).arg(angle).toLatin1()) << transformForAngle(angle) << (int)QImage::Format_ARGB32_Premultiplied;
+ //for (float angle = 0; angle < 360; angle += 10)
+ // QTest::newRow(QString(QLatin1String("angle=%1; imagetype=ARGB8565_Pre")).arg(angle).toLatin1()) << transformForAngle(angle) << (int)QImage::Format_ARGB8565_Premultiplied;
+
+}
+
+//code from QFxRect for drawing rounded rects
+void tst_QmlPainting::drawTransformedScaleGridRoundedRect()
+{
+ QFETCH(QTransform, transform);
+ QFETCH(int, imageType);
+
+ //setup image
+ const int pw = 1;
+ const int radius = 10;
+ QImage rectImage(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2, (QImage::Format)imageType);
+ rectImage.fill(0);
+ QPainter rp(&rectImage);
+ rp.setRenderHint(QPainter::Antialiasing);
+ rp.setPen(Qt::black);
+ rp.setBrush(Qt::red);
+ if (pw%2)
+ rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
+ else
+ rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
+
+ //setup surface
+ QImage surface(400, 400, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(transform);
+ const int pw = 2;
+ int offset = int(radius+1.5+pw);
+ int width = 80;
+ int height = 80;
+
+ int w = width+pw;
+ int h = height+pw;
+ int xOffset = offset;
+ int xSide = xOffset * 2;
+ bool xMiddles=true;
+ if (xSide > w) {
+ xMiddles=false;
+ xOffset = w/2 + 1;
+ xSide = xOffset * 2;
+ }
+ int yOffset = offset;
+ int ySide = yOffset * 2;
+ bool yMiddles=true;
+ if (ySide > h) {
+ yMiddles = false;
+ yOffset = h/2 + 1;
+ ySide = yOffset * 2;
+ }
+
+ // Upper left
+ p.drawImage(QRect(100-pw/2, 100-pw/2, xOffset, yOffset), rectImage, QRect(0, 0, xOffset, yOffset));
+
+ // Upper middle
+ if (xMiddles)
+ p.drawImage(QRect(100+xOffset-pw/2, 100+-pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, 0, 1, yOffset));
+ // Upper right
+ p.drawImage(QPoint(100+width-xOffset+pw/2, 100+-pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, 0, xOffset, yOffset));
+ // Middle left
+ if (yMiddles)
+ p.drawImage(QRect(100+-pw/2, 100+yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(0, rectImage.height()/2, xOffset, 1));
+
+ // Middle
+ if (xMiddles && yMiddles)
+ p.drawImage(QRect(100+xOffset-pw/2, 100+yOffset-pw/2, width - xSide + pw, height - ySide + pw), rectImage,
+ QRect(rectImage.width()/2, rectImage.height()/2, 1, 1));
+ // Middle right
+ if (yMiddles)
+ p.drawImage(QRect(100+width-xOffset+pw/2, 100+yOffset-pw/2, xOffset, height - ySide + pw), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height()/2, xOffset, 1));
+ // Lower left
+ p.drawImage(QPoint(100+-pw/2, 100+height - yOffset + pw/2), rectImage, QRect(0, rectImage.height() - yOffset, xOffset, yOffset));
+
+ // Lower Middle
+ if (xMiddles)
+ p.drawImage(QRect(100+xOffset-pw/2, 100+height - yOffset +pw/2, width - xSide + pw, yOffset), rectImage,
+ QRect(rectImage.width()/2, rectImage.height() - yOffset, 1, yOffset));
+ // Lower Right
+ p.drawImage(QPoint(100+width-xOffset+pw/2, 100+height - yOffset+pw/2), rectImage,
+ QRect(rectImage.width()-xOffset, rectImage.height() - yOffset, xOffset, yOffset));
+ }
+ surface.save("tsg.png");
+}
+
+void tst_QmlPainting::drawTransformedTransparentImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QmlPainting::drawTransformedTransparentImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage transImage(200, 200, (QImage::Format)imageType);
+ transImage.fill(0);
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, transImage);
+ }
+}
+
+void tst_QmlPainting::drawTransformedSemiTransparentImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QmlPainting::drawTransformedSemiTransparentImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage transImage(200, 200, (QImage::Format)imageType);
+ transImage.fill(QColor(0,0,0, 128).rgba());
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, transImage);
+ }
+}
+
+void tst_QmlPainting::drawTransformedFilledImage_data()
+{
+ QTest::addColumn<int>("imageType");
+
+ QTest::newRow("imagetype=ARGB32_Pre") << (int)QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("imagetype=ARGB8565_Pre") << (int)QImage::Format_ARGB8565_Premultiplied;
+}
+
+void tst_QmlPainting::drawTransformedFilledImage()
+{
+ QFETCH(int, imageType);
+
+ //setup image
+ QImage filledImage(200, 200, (QImage::Format)imageType);
+ filledImage.fill(QColor(0,0,0).rgb());
+
+ //setup surface
+ QImage surface(200, 200, QImage::Format_RGB16);
+ surface.fill(QColor(255,255,255).rgb());
+ QPainter p(&surface);
+
+ QBENCHMARK {
+ p.setWorldTransform(QTransform(0.956957, 0, 0.000704124, 0, 1, 0, 16.141, 0, 0.735953));
+ p.drawImage(0,0, filledImage);
+ }
+}
+
+QTEST_MAIN(tst_QmlPainting)
+
+#include "tst_qmlpainting.moc"
diff --git a/tests/benchmarks/qmlxmlparser/main.cpp b/tests/benchmarks/qmlxmlparser/main.cpp
deleted file mode 100644
index 17dc7f3..0000000
--- a/tests/benchmarks/qmlxmlparser/main.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <QTest>
-#include <QtXml>
-#include <QmlComponent>
-
-class tst_qmlxmlparser : public QObject
-{
- Q_OBJECT
-
-public:
- enum XmlParser { ParserQXmlStreamReader = 0, ParserQmlComponent };
-
-private slots:
- void parse();
- void parse_data();
-
-private:
- QString readFile(QString const&);
-};
-
-/*
- Benchmark the parsing of Qml, using QXmlStreamReader as a baseline.
- This gives an idea of the overhead Qml imposes over the top of plain XML parsing.
-*/
-void tst_qmlxmlparser::parse()
-{
- QFETCH(QString, xml);
- QFETCH(int, parser);
-
- if (parser == ParserQXmlStreamReader) {
- QBENCHMARK {
- QXmlStreamReader parser(xml);
- while (!parser.atEnd()) parser.readNext();
- }
- }
- else if (parser == ParserQmlComponent) {
- QByteArray ba = xml.toLatin1();
- QBENCHMARK {
- QmlComponent qmlc(ba);
- }
- }
-}
-
-void tst_qmlxmlparser::parse_data()
-{
- QTest::addColumn<QString>("xml");
- QTest::addColumn<int> ("parser");
-
- QTest::newRow("empty-qxml")
- << QString()
- << (int)ParserQXmlStreamReader;
-
- QTest::newRow("empty-qml")
- << QString()
- << (int)ParserQmlComponent;
-
- {
- QString xml = QString::fromLatin1("<Item prop1=\"foo\"><Prop2 value=\"bar\"/></Item>");
-
- QTest::newRow("simple-qxml")
- << xml
- << (int)ParserQXmlStreamReader;
-
- QTest::newRow("simple-qml")
- << xml
- << (int)ParserQmlComponent;
- }
-
- {
- QString xml = readFile("concept2.xml");
-
- QTest::newRow("concept2-qxml")
- << xml
- << (int)ParserQXmlStreamReader;
-
- QTest::newRow("concept2-qml")
- << xml
- << (int)ParserQmlComponent;
- }
-}
-
-QString tst_qmlxmlparser::readFile(QString const& filename)
-{
-#define _STR(X) #X
-#define STR(X) _STR(X)
- QFile file(QString("%1/testdata/%2").arg(STR(SRCDIR)).arg(filename));
- if (!file.open(QIODevice::ReadOnly)) {
- qFatal("Could not open %s: %s", qPrintable(filename), qPrintable(file.errorString()));
- }
- QByteArray ba = file.readAll();
- return QString::fromLatin1(ba);
-}
-
-
-QTEST_MAIN(tst_qmlxmlparser)
-
-#include "main.moc"
diff --git a/tests/benchmarks/qmlxmlparser/qmlxmlparser.pro b/tests/benchmarks/qmlxmlparser/qmlxmlparser.pro
deleted file mode 100644
index e31c692..0000000
--- a/tests/benchmarks/qmlxmlparser/qmlxmlparser.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-load(qttest_p4)
-TEMPLATE = app
-TARGET = tst_qmlxmlparser
-DEPENDPATH += .
-INCLUDEPATH += .
-
-CONFIG += release
-
-QT += declarative xml
-
-DEFINES+=SRCDIR=\"$$PWD\"
-
-# Input
-SOURCES += main.cpp
diff --git a/tests/benchmarks/qmlxmlparser/testdata/concept2.xml b/tests/benchmarks/qmlxmlparser/testdata/concept2.xml
deleted file mode 100644
index 67c625d..0000000
--- a/tests/benchmarks/qmlxmlparser/testdata/concept2.xml
+++ /dev/null
@@ -1,421 +0,0 @@
-<Item id="Screen" width="320" height="240">
- <Item id="Main" anchors.fill="{parent}">
-
- <Script source="concept2.js"/>
-
- <resources>
-
- <ListModel id="TabModel">
- <ListItem>
- <name>Favorites</name>
- <image>pics/favorites.png</image>
- <highlightColor>#BE0000</highlightColor>
- </ListItem>
- <ListItem>
- <name>Phone</name>
- <image>pics/calls.png</image>
- <highlightColor>#BE00B5</highlightColor>
- </ListItem>
- <ListItem>
- <name>Messages</name>
- <image>pics/messaging.png</image>
- <highlightColor>#1000BE</highlightColor>
- </ListItem>
- <ListItem>
- <name>Applications</name>
- <image>pics/apps.png</image>
- <highlightColor>#00AEBE</highlightColor>
- </ListItem>
- <ListItem>
- <name>Media Center</name>
- <image>pics/media.png</image>
- <highlightColor>#06BE00</highlightColor>
- </ListItem>
- <ListItem>
- <name>Settings</name>
- <image>pics/settings.png</image>
- <highlightColor>#CF7900</highlightColor>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel1">
- <ListItem>
- <name>Games</name>
- </ListItem>
- <ListItem>
- <name>Contacts</name>
- </ListItem>
- <ListItem>
- <name>Clock</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel2">
- <ListItem>
- <name>Contacts</name>
- </ListItem>
- <ListItem>
- <name>Missed Calls</name>
- </ListItem>
- <ListItem>
- <name>Received Calls</name>
- </ListItem>
- <ListItem>
- <name>Dialed Numbers</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel3">
- <ListItem>
- <name>Inbox</name>
- </ListItem>
- <ListItem>
- <name>Sent</name>
- </ListItem>
- <ListItem>
- <name>Drafts</name>
- </ListItem>
- <ListItem>
- <name>Email</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel4">
- <ListItem>
- <name>Calculator</name>
- </ListItem>
- <ListItem>
- <name>Calendar</name>
- </ListItem>
- <ListItem>
- <name>Camera</name>
- </ListItem>
- <ListItem>
- <name>Clock</name>
- </ListItem>
- <ListItem>
- <name>Notes</name>
- </ListItem>
- <ListItem>
- <name>Web Browser</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel5">
- <ListItem>
- <name>Pictures</name>
- </ListItem>
- <ListItem>
- <name>Music</name>
- </ListItem>
- <ListItem>
- <name>Videos</name>
- </ListItem>
- <ListItem>
- <name>Games</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="ListModel6">
- <ListItem>
- <name>Appearance</name>
- </ListItem>
- <ListItem>
- <name>Bluetooth</name>
- </ListItem>
- <ListItem>
- <name>Date/Time</name>
- </ListItem>
- <ListItem>
- <name>Power Management</name>
- </ListItem>
- </ListModel>
-
- <ListModel id="AlarmsModel">
- <ListItem>
- <time>7:30</time>
- <label>Wake Up!</label>
- <repeat>Weekdays</repeat>
- <status>on</status>
- </ListItem>
- <ListItem>
- <time>9:00</time>
- <label>Exercise</label>
- <repeat>Weekends</repeat>
- <status>on</status>
- </ListItem>
- </ListModel>
-
- <Component id="TabDelegate">
- <Item width="53" height="36">
- <Image file="{image}" x="15" y="7" />
- <ColorAnimation target="{TitleBar}" property="highlightColor" running="{index == TabListView.currentIndex}" to="{highlightColor}" duration="300"/>
- <NumericAnimation target="{Lists}" property="x" running="{index == TabListView.currentIndex}" to="{-TabListView.currentIndex * 320}" duration="300" easing="easeInOutQuad"/>
- <Bind target="{Title}" property="text" value="{if (index == TabListView.currentIndex) name;}"/>
- </Item>
- </Component>
-
- <Component id="TabHighlight">
- <Image file="titlebar-selection.png"/>
- </Component>
-
- <Component id="ListDelegate">
- <Item x="12" width="{Main.width}" height="30">
- <Text id="AppNameBlack" text="{name}" width="{parent.width}" height="{parent.height}" vAlign="AlignVCenter" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript"/>
- <Text id="AppNameWhite" text="{name}" width="{parent.width}" height="{parent.height}" vAlign="AlignVCenter" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" color="white" opacity="0"/>
- <states>
- <State name="currentItem" when="{list.currentIndex == index}">
- <SetProperty target="{AppNameBlack}" property="opacity" value="0"/>
- <SetProperty target="{AppNameWhite}" property="opacity" value="1"/>
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation property="opacity" duration="250"/>
- </Transition>
- </transitions>
- </Item>
- </Component>
-
- <Component id="ContactDelegate">
- <KeyActions id="Wrapper" width="{Main.width}" focusable="true" height="30"
- leftArrow="PhoneDetails.currentState='BusinessDetails'"
- rightArrow="PhoneDetails.currentState='BusinessDetails'">
-
- <!--<Rect id="Highlight" width="{Main.width - 6}" x="3" radius="4" height="60" color="black" opacity="0"/>-->
- <Image id="Portrait" file="{portrait}" x="10" y="5" opacity="0"/>
- <Item id="ContactName" x="18" y="5">
- <Text id="NameBlack" text="{firstName + ' '+ lastName}" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript"/>
- <Text id="NameWhite" text="{firstName + ' '+ lastName}" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" color="white" opacity="0"/>
- </Item>
- <Item id="PhoneDetails" opacity="0">
- <Item id="HomeDetails">
- <Image file="pics/homephone.png" x="75" y="30"/>
- <Text text="{homephone}" x="105" y="33" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" color="white"/>
- </Item>
- <Item id="BusinessDetails" opacity="0">
- <Image file="pics/businessmobile.png" x="75" y="30"/>
- <Text text="{businessmobile}" x="105" y="33" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" color="white"/>
- </Item>
- <states>
- <State name="BusinessDetails">
- <SetProperty target="{HomeDetails}" property="opacity" value="0"/>
- <SetProperty target="{BusinessDetails}" property="opacity" value="1"/>
- <SetProperties target="{Wrapper}" leftArrow="PhoneDetails.currentState=''" rightArrow="PhoneDetails.currentState=''" />
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation properties="opacity" duration="250"/>
- </Transition>
- </transitions>
- </Item>
- <states>
- <State name="currentItem" when="{list.currentIndex == index}">
- <SetProperty target="{Wrapper}" property="focus" value="true"/>
- <SetProperty target="{NameBlack}" property="opacity" value="0"/>
- <SetProperty target="{NameWhite}" property="opacity" value="1"/>
- <SetProperty target="{Wrapper}" property="height" value="60" />
- <SetProperty target="{Portrait}" property="opacity" value="1" />
- <SetProperty target="{ContactName}" property="x" value="70" />
- <SetProperty target="{PhoneDetails}" property="opacity" value="1" />
- <SetProperty target="{Highlight}" property="opacity" value="1" />
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation properties="opacity,height,y,x" duration="250"/>
- </Transition>
- </transitions>
- </KeyActions>
- </Component>
-
- <Component id="ListHighlight">
- <Item>
- <Rect width="{Main.width-6}" x="-9" height="{parent.height}" color="#242424" radius="4"/>
- </Item>
- </Component>
-
- <Component id="AlarmsDelegate">
- <KeyActions id="Wrapper" width="{Main.width}" focusable="true" height="60" escape="Wrapper.currentState = 'currentItem'" return="Wrapper.currentState = 'EditMode'">
- <Image file="pics/alarm.png" x="10" anchors.verticalCenter="{parent.verticalCenter}"/>
- <Text id="TimeBlack" text="{time}" anchors.verticalCenter="{parent.verticalCenter}" x="50" font.size="16" font.bold="true" font.family="Nokia Large"/>
- <Text id="TimeWhite" text="{time}" anchors.verticalCenter="{parent.verticalCenter}" x="50" font.size="16" font.bold="true" font.family="Nokia Large" color="white" opacity="0"/>
- <Text id="LabelBlack" text="{label}" x="110" y="4" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript"/>
- <Text id="LabelWhite" text="{label}" x="110" y="4" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" color="white" opacity="0"/>
- <Text id="RepeatBlack" text="{repeat}" x="110" y="25" font.size="10" font.family="Nokia Standard Multiscript"/>
- <Text id="RepeatWhite" text="{repeat}" x="110" y="25" font.size="10" font.family="Nokia Standard Multiscript" color="white" opacity="0"/>
- <states>
- <State name="currentItem" when="{list.currentIndex == index}">
- <SetProperty target="{Wrapper}" property="focus" value="true"/>
- <SetProperty target="{TimeBlack}" property="opacity" value="0"/>
- <SetProperty target="{TimeWhite}" property="opacity" value="1"/>
- <SetProperty target="{LabelBlack}" property="opacity" value="0"/>
- <SetProperty target="{LabelWhite}" property="opacity" value="1"/>
- <SetProperty target="{RepeatBlack}" property="opacity" value="0"/>
- <SetProperty target="{RepeatWhite}" property="opacity" value="1"/>
- </State>
- <State name="EditMode" extends="currentItem">
- <SetProperty target="{list}" property="x" value="-320"/>
- <SetProperty target="{AlarmDetails}" property="active" value="true"/>
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation properties="opacity,height,y,x,yPosition" duration="250"/>
- </Transition>
- </transitions>
- </KeyActions>
- </Component>
-
- </resources>
-
- <Image id="Background" file="pics/background.png" opaque="true"/>
-
- <Item id="TitleBar">
- <properties>
- <Property name="index" value="0" type="Int"/>
- <Property name="highlightColor" type="Color"/>
- </properties>
- <Rect id="TitleBarBackground" y="0" gradientColor="black" color="{'#676767'}" width="320" height="24"/>
- <Image id="HeaderShadow" file="pics/header-shadow.png" anchors.top="{TitleBarBackground.bottom}" width="320"/>
- <Item id="TitleBarContent" width="320" height="24">
- <Text id="Operator" text="Qt Extended" x="5" style="Sunken" styleColor="#333333" width="155" height="{parent.height}" color="white" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" vAlign="AlignVCenter"/>
- <Text id="Title" text="" x="5" style="Sunken" styleColor="#333333" width="155" height="{parent.height}" color="white" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" vAlign="AlignVCenter" opacity="0"/>
- <Text id="Time" text="10:52 AM" style="Sunken" styleColor="#333333" x="160" width="155" height="{parent.height}" color="white" font.size="10" font.bold="true" font.family="Nokia Standard Multiscript" hAlign="AlignRight" vAlign="AlignVCenter"/>
- </Item>
- <ListView id="TabListView" currentIndex="{TitleBar.index}" y="24" width="320" height="36" model="{TabModel}" delegate="{TabDelegate}" highlight="{TabHighlight}" clip="true" currentItemMode="Click" orientation="Qt::Horizontal" opacity="0"/>
- <states>
- <State name="coloredState">
- <SetProperty target="{TitleBarBackground}" property="color" binding="TitleBar.highlightColor" />
- <SetProperty target="{MenuBarBackground}" property="color" binding="TitleBar.highlightColor" />
- </State>
- <State name="Expanded" extends="coloredState">
- <SetProperty target="{TitleBarBackground}" property="height" value="60"/>
- <SetProperty target="{TabListView}" property="opacity" value="1"/>
- <SetProperty target="{Lists}" property="y" value="63"/>
- <SetProperty target="{Title}" property="opacity" value="1"/>
- <SetProperty target="{Operator}" property="x" value="-155"/>
- <SetProperty target="{ListBackground}" property="y" value="60"/>
- <SetProperty target="{List1}" property="focus" value="true"/>
- <SetProperty target="{HeaderShadow}" property="opacity" value="0"/>
- <SetProperty target="{ContextKey2}" property="text" value="Select"/>
- <SetProperty target="{ContextKey3}" property="text" value="Back"/>
- </State>
- <State name="ApplicationLaunched" extends="coloredState">
- <SetProperty target="{Lists}" property="opacity" value="0"/>
- <SetProperty target="{Title}" property="opacity" value="1"/>
- <SetProperty target="{Operator}" property="x" value="-155"/>
- <SetProperty target="{ListBackground}" property="y" value="24"/>
- <SetProperty target="{ContextKey2}" property="text" value="Select"/>
- <SetProperty target="{ContextKey3}" property="text" value="Back"/>
- </State>
- <State name="ContactsLaunched" extends="ApplicationLaunched">
- <SetProperty target="{ContactList}" property="focus" value="true"/>
- <SetProperty target="{ContactList}" property="opacity" value="1"/>
- </State>
- <State name="AlarmsLaunched" extends="ApplicationLaunched">
- <SetProperty target="{AlarmList}" property="focus" value="true"/>
- <SetProperty target="{AlarmList}" property="opacity" value="1"/>
- </State>
- </states>
- <transitions>
- <Transition fromState="*" toState="Expanded" reversible="true">
- <SerialAnimation>
- <NumericAnimation properties="x,y,height" easing="easeInOutQuad" duration="300"/>
- <NumericAnimation properties="opacity" duration="200"/>
- </SerialAnimation>
- </Transition>
- <Transition fromState="Expanded" toState="ContactsLaunched" reversible="true">
- <NumericAnimation properties="x,y,height,opacity" easing="easeInOutQuad" duration="300"/>
- </Transition>
- <Transition fromState="Expanded" toState="AlarmsLaunched" reversible="true">
- <NumericAnimation properties="x,y,height,opacity" easing="easeInOutQuad" duration="300"/>
- </Transition>
- </transitions>
- </Item>
-
- <Rect id="ListBackground" color="#cdcdcd" y="237" width="320" height="216"/>
- <Item id="Lists" y="240" width="320" height="150" onKeyPress="keyPressed(event.key)">
- <ListView id="List1" focusable="true" focus="true" width="{parent.width}" height="150" model="{ListModel1}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- <ListView id="List2" focusable="true" x="320" width="{parent.width}" height="150" model="{ListModel2}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- <ListView id="List3" focusable="true" x="640" width="{parent.width}" height="150" model="{ListModel3}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- <ListView id="List4" focusable="true" x="960" width="{parent.width}" height="150" model="{ListModel4}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- <ListView id="List5" focusable="true" x="1280" width="{parent.width}" height="150" model="{ListModel5}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- <ListView id="List6" focusable="true" x="1600" width="{parent.width}" height="150" model="{ListModel6}" delegate="{ListDelegate}" clip="true" currentItemMode="Click" highlight="{ListHighlight}" wrap="true"/>
- </Item>
-
- <ListView id="ContactList" model="{contactModel}" y="27" height="186" width="320" opacity="0" clip="true" focusable="true" focus="false" delegate="{ContactDelegate}" currentItemMode="Click" onKeyPress="contactsKeyPressed(event.key)">
- <children>
- <Rect color="#242424" radius="4" width="320" height="60" id="ContactListRect" y="{ContactList.currentIndex * 30}">
- <Text text="{parent.y}" color="white" anchors.right="{parent.right}"/>
- <y>
- <Behaviour>
- <NumericAnimation property="y" duration="250" />
- </Behaviour>
- </y>
- </Rect>
- </children>
- </ListView>
- <ListView id="AlarmList" model="{AlarmsModel}" y="27" height="186" width="320" clip="true" focusable="true" focus="false" delegate="{AlarmsDelegate}" highlight="{ListHighlight}" currentItemMode="Click" onKeyPress="alarmKeyPressed(event.key)" opacity="0"/>
- <FocusPanel id="AlarmDetails" anchors.left="{AlarmList.right}" y="27" height="186" width="320" active="false">
- <VerticalLayout anchors.fill="{parent}">
- <EditableText id="et1" label="Label" focus="true" text="Wake Up!" height="40" width="{AlarmList.width}"/>
- <EditableText id="et2" label="Time" text="07:45" height="40" width="{AlarmList.width}"/>
- <EditableText id="et3" label="Frequency" text="Weekdays" height="40" width="{AlarmList.width}"/>
- </VerticalLayout>
- </FocusPanel>
-
-<!-- <Clock id="Clock" x="70" y="30" opacity="0" hour="2" minute="59" focusable="true" onKeyPress="keyPressed(event.key)"/>-->
-
- <Rect id="MenuBarBackground" gradientColor="black" color="{'#676767'}" y="216" width="320" height="24" />
- <FocusPanel active="{currentState=='ToolBar'}" id="MenuBar" y="216" width="320" height="24">
- <KeyActions c="MenuBar.currentState=''" focusable="true" focus="true" />
- <Rect width="{MenuBar.width}" height="1" color="black" opacity="0.2"/>
- <Item id="ContextKeys" anchors.fill="{parent}">
- <states>
- <State name="Hidden" when="{QuickMenu.expanded == true}">
- <SetProperty target="{ContextKeys}" property="opacity" value="0" />
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation properties="opacity" duration="300" />
- </Transition>
- </transitions>
-
- <SoftText id="ContextKey1" text="Options" anchors.verticalCenter="{parent.verticalCenter}" x="35" />
- <SoftText id="ContextKey2" text="Menu" anchors.horizontalCenter="{parent.horizontalCenter}" anchors.verticalCenter="{parent.verticalCenter}" />
- <SoftText id="ContextKey3" text="" anchors.verticalCenter="{parent.verticalCenter}" x="290" />
- <MouseRegion height="{parent.height}" width="106" onClick="contextKey1Cliked();"/>
- <MouseRegion height="{parent.height}" x="107" width="106" onClick="contextKey2Cliked();"/>
- <MouseRegion height="{parent.height}" x="213" width="106" onClick="contextKey3Cliked();"/>
- </Item>
- <HorizontalLayout id="ToolBar" opacity="0">
- <ToolButton id="NewButton" text="New" icon="pics/document-new.png"/>
- <ToolButton id="EditButton" text="Edit" icon="pics/edit-rename.png"/>
- <ToolButton id="DeleteButton" text="Delete" icon="pics/edit-delete.png"/>
- <ToolButton id="DeleteButton2" text="Delete" icon="pics/edit-delete.png"/>
- </HorizontalLayout>
- <states>
- <State name="ToolBar">
- <SetProperty target="{MenuBarBackground}" property="y" value="180"/>
- <SetProperty target="{MenuBarBackground}" property="height" value="62"/>
- <SetProperty target="{MenuBar}" property="y" value="180"/>
- <SetProperty target="{MenuBar}" property="height" value="60"/>
- <SetProperty target="{ContextKeys}" property="opacity" value="0"/>
- <SetProperty target="{ToolBar}" property="opacity" value="1"/>
- </State>
- </states>
- <transitions>
- <Transition fromState="*" toState="ToolBar" reversible="true">
- <NumericAnimation properties="y,height,opacity" easing="easeInOutQuad" duration="250"/>
- </Transition>
- </transitions>
- </FocusPanel>
-
- </Item>
-
- <CallMenu id="QuickMenu"/>
-
-</Item>