diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-05-20 15:39:07 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-05-20 15:49:38 +1000 |
commit | 221f7f3c81e233125f5dc3ce47ef0518fafea815 (patch) | |
tree | ffbc892bfb9cc3edab14bbb4702d979c348a42a6 /tests/auto/declarative/qsgimage | |
parent | b3a03ede2badc0433345c90f96f4968869bfd8f8 (diff) |
Support 'mirror: true' in SG Image element.
Change-Id: Id94e5557e8ebbed4494fb342b87b8b595e01b38b
Diffstat (limited to 'tests/auto/declarative/qsgimage')
-rw-r--r-- | tests/auto/declarative/qsgimage/data/mirror.qml | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qsgimage/tst_qsgimage.cpp | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/tests/auto/declarative/qsgimage/data/mirror.qml b/tests/auto/declarative/qsgimage/data/mirror.qml index 69bdcb9dc3..101a3a28ce 100644 --- a/tests/auto/declarative/qsgimage/data/mirror.qml +++ b/tests/auto/declarative/qsgimage/data/mirror.qml @@ -1,5 +1,11 @@ import QtQuick 2.0 -Image { - source: "heart200.png" +Rectangle { + width: 300 + height: 250 + Image { + objectName: "image" + anchors.fill: parent + source: "heart200.png" + } } diff --git a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp index ff5de4baf5..a8dadf0444 100644 --- a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp +++ b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp @@ -284,17 +284,16 @@ void tst_qsgimage::mirror() qreal height = 250; QSGView *canvas = new QSGView; - canvas->show(); canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirror.qml")); - QSGImage *obj = qobject_cast<QSGImage*>(canvas->rootObject()); + QSGImage *obj = canvas->rootObject()->findChild<QSGImage*>("image"); QVERIFY(obj != 0); - obj->setProperty("width", width); - obj->setProperty("height", height); obj->setFillMode((QSGImage::FillMode)fillMode); obj->setProperty("mirror", true); + canvas->show(); + QPixmap screenshot = canvas->renderPixmap(); QPixmap srcPixmap; |