summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-22 01:41:23 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-22 01:41:23 (GMT)
commitcef8907c1fd74f5b5d12b0c10c4b18a90233006a (patch)
tree5a485ebbefcdae180877d9926ae35bc0e28f2b56
parentf595c880cf68225d300547d31f13cf9520be3846 (diff)
parent8bbe895759bc32d6a005d3308f04179a7931348c (diff)
downloadQt-cef8907c1fd74f5b5d12b0c10c4b18a90233006a.zip
Qt-cef8907c1fd74f5b5d12b0c10c4b18a90233006a.tar.gz
Qt-cef8907c1fd74f5b5d12b0c10c4b18a90233006a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/binding.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/color.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/explicit.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/groupProperty.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/parent.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/simple.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp30
-rw-r--r--tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp30
-rw-r--r--tests/benchmarks/declarative/painting/paintbenchmark.cpp24
12 files changed, 55 insertions, 47 deletions
diff --git a/tests/auto/declarative/qmlbehaviors/data/binding.qml b/tests/auto/declarative/qmlbehaviors/data/binding.qml
index e0c3321..18d6764 100644
--- a/tests/auto/declarative/qmlbehaviors/data/binding.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/binding.qml
@@ -9,7 +9,7 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100; color: "green"
x: basex
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
MouseRegion {
id: clicker
diff --git a/tests/auto/declarative/qmlbehaviors/data/color.qml b/tests/auto/declarative/qmlbehaviors/data/color.qml
index 6598703..aac7283 100644
--- a/tests/auto/declarative/qmlbehaviors/data/color.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/color.qml
@@ -7,7 +7,7 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100;
color: "green"
- color: Behavior { ColorAnimation { duration: 200; } }
+ color: Behavior { ColorAnimation { duration: 500; } }
}
MouseRegion {
id: clicker
diff --git a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
index ba507c4..8d032f0 100644
--- a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
@@ -6,6 +6,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/explicit.qml b/tests/auto/declarative/qmlbehaviors/data/explicit.qml
index ba36d93..bb17076 100644
--- a/tests/auto/declarative/qmlbehaviors/data/explicit.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/explicit.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {
objectName: "MyBehavior";
- NumberAnimation { target: rect; property: "x"; duration: 200; }
+ NumberAnimation { target: rect; property: "x"; duration: 500; }
}
}
MouseRegion {
diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
index 4f127c1..8a734c1 100644
--- a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos: Behavior { PropertyAnimation { duration: 200; } }
+ pos: Behavior { PropertyAnimation { duration: 500; } }
}
MouseRegion {
id: clicker
diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
index 19d70b6..602ffbb 100644
--- a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos.x: Behavior { NumberAnimation { duration: 200; } }
+ pos.x: Behavior { NumberAnimation { duration: 500; } }
}
MouseRegion {
id: clicker
diff --git a/tests/auto/declarative/qmlbehaviors/data/parent.qml b/tests/auto/declarative/qmlbehaviors/data/parent.qml
index 4f4911b..7c7fdcb 100644
--- a/tests/auto/declarative/qmlbehaviors/data/parent.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/parent.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
parent: Behavior {
SequentialAnimation {
- PauseAnimation { duration: 200 }
+ PauseAnimation { duration: 500 }
PropertyAction {}
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
index 4383a0b..a91ca88 100644
--- a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
@@ -11,6 +11,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/simple.qml b/tests/auto/declarative/qmlbehaviors/data/simple.qml
index 37c3915..c08a1f0 100644
--- a/tests/auto/declarative/qmlbehaviors/data/simple.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/simple.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {
objectName: "MyBehavior";
- NumberAnimation { duration: 200; }
+ NumberAnimation { duration: 500; }
}
}
MouseRegion {
diff --git a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
index 99ec728..e31b600 100644
--- a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
+++ b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
@@ -79,7 +79,7 @@ void tst_qmlbehaviors::simpleBehavior()
QVERIFY(qobject_cast<QmlBehavior*>(rect->findChild<QmlBehavior*>("MyBehavior"))->animation());
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -92,7 +92,7 @@ void tst_qmlbehaviors::scriptTriggered()
QVERIFY(rect);
rect->setColor(QColor("red"));
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -108,7 +108,7 @@ void tst_qmlbehaviors::cppTriggered()
QVERIFY(innerRect);
innerRect->setProperty("x", 200);
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = innerRect->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -132,7 +132,7 @@ void tst_qmlbehaviors::colorBehavior()
QVERIFY(rect);
rect->setState("red");
- QTest::qWait(100);
+ QTest::qWait(200);
QColor color = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->color();
QVERIFY(color != QColor("red") && color != QColor("green")); //i.e. the behavior has been triggered
}
@@ -145,11 +145,11 @@ void tst_qmlbehaviors::parentBehavior()
QVERIFY(rect);
rect->setState("reparented");
- QTest::qWait(100);
+ QTest::qWait(200);
QmlGraphicsItem *newParent = rect->findChild<QmlGraphicsItem*>("NewParent");
QmlGraphicsItem *parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem();
QVERIFY(parent != newParent);
- QTest::qWait(300);
+ QTest::qWait(600);
parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem();
QVERIFY(parent == newParent);
}
@@ -162,29 +162,29 @@ void tst_qmlbehaviors::replaceBinding()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"));
QVERIFY(innerRect);
qreal x = innerRect->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)200);
rect->setProperty("basex", 10);
QCOMPARE(innerRect->x(), (qreal)200);
rect->setProperty("movedx", 210);
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)210);
rect->setState("");
- QTest::qWait(100);
+ QTest::qWait(200);
x = innerRect->x();
QVERIFY(x > 10 && x < 210); //i.e. the behavior has been triggered
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)10);
rect->setProperty("movedx", 200);
QCOMPARE(innerRect->x(), (qreal)10);
rect->setProperty("basex", 20);
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)20);
}
@@ -197,7 +197,7 @@ void tst_qmlbehaviors::group()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -209,7 +209,7 @@ void tst_qmlbehaviors::group()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -236,7 +236,7 @@ void tst_qmlbehaviors::explicitSelection()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
index 00127e5..2520d4a 100644
--- a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
+++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
@@ -645,45 +645,29 @@ void tst_QmlGraphicsGridView::currentIndex()
QCOMPARE(gridview->viewportY(), 0.0);
// Test keys
+ qApp->setActiveWindow(canvas);
canvas->show();
canvas->setFocus();
qApp->processEvents();
- QEvent wa(QEvent::WindowActivate);
- QApplication::sendEvent(canvas, &wa);
- QFocusEvent fe(QEvent::FocusIn);
- QApplication::sendEvent(canvas, &fe);
-
- QKeyEvent key(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Down);
QCOMPARE(gridview->currentIndex(), 3);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Up);
QCOMPARE(gridview->currentIndex(), 0);
gridview->setFlow(QmlGraphicsGridView::TopToBottom);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Right);
QCOMPARE(gridview->currentIndex(), 5);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Left);
QCOMPARE(gridview->currentIndex(), 0);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Down);
QCOMPARE(gridview->currentIndex(), 1);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Up);
QCOMPARE(gridview->currentIndex(), 0);
diff --git a/tests/benchmarks/declarative/painting/paintbenchmark.cpp b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
index 9231b67..073e14e 100644
--- a/tests/benchmarks/declarative/painting/paintbenchmark.cpp
+++ b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
@@ -43,6 +43,7 @@
#include <QPixmap>
#include <QImage>
#include <QPainter>
+#include <QPainterPath>
#include <QGLWidget>
#include <QTextLayout>
#include <QVBoxLayout>
@@ -218,6 +219,28 @@ void paint_QPixmapCachedRoundedRect(QPainter &p)
}
}
+void paint_pathCacheRoundedRect(QPainter &p)
+{
+ static bool first = true;
+ static QPainterPath path[lines];
+ if (first) {
+ for (int j = 0; j < lines; ++j) {
+ path[j].addRoundedRect(QRectF(0,0,(j+1)*50, spacing-1), 8, 8);
+ }
+ first = false;
+ }
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(Qt::black);
+ p.setBrush(Qt::red);
+ for (int i = 0; i < count; i++) {
+ for (int j = 0; j < lines; ++j) {
+ p.translate(0,j*spacing);
+ p.drawPath(path[j]);
+ p.translate(0,-j*spacing);
+ }
+ }
+}
+
void paint_QPixmap63x63_opaque(QPainter &p)
{
static bool first = true;
@@ -290,6 +313,7 @@ struct {
{ "CachedText", &paint_QPixmapCachedText },
{ "RoundedRect", &paint_RoundedRect },
{ "CachedRoundedRect", &paint_QPixmapCachedRoundedRect },
+ { "PathCacheRoundedRect", &paint_pathCacheRoundedRect },
{ "QPixmap63x63_opaque", &paint_QPixmap63x63_opaque },
{ "QPixmap64x64_opaque", &paint_QPixmap64x64_opaque },
{ "QPixmap63x63", &paint_QPixmap63x63 },