summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeimage
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-08 16:06:51 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-08 16:06:51 (GMT)
commitf6f2d03b2d74b236d33a5ca32a49f138bf521c13 (patch)
treef81b90ddc4f2b34bf0e9a56bbebbebb1dac9cc7d /tests/auto/declarative/qdeclarativeimage
parent7c8980ee041e874a6c430f01b2daff4955517b03 (diff)
parent75fd46451cabd680d16913d5dfd4733c09db3459 (diff)
downloadQt-f6f2d03b2d74b236d33a5ca32a49f138bf521c13.zip
Qt-f6f2d03b2d74b236d33a5ca32a49f138bf521c13.tar.gz
Qt-f6f2d03b2d74b236d33a5ca32a49f138bf521c13.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'tests/auto/declarative/qdeclarativeimage')
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp10
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml b/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
index 739299d..cd092bc 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
+++ b/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
@@ -1,6 +1,10 @@
import QtQuick 1.0
Image {
+ property int widthChange: 0
+ property int heightChange: 0
source: "heart.png"
fillMode: Image.PreserveAspectFit;
+ onWidthChanged: widthChange += 1
+ onHeightChanged: heightChange += 1
}
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index c5a3d14..87e3347 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -248,14 +248,22 @@ void tst_qdeclarativeimage::preserveAspectRatio()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
QVERIFY(image != 0);
+ QCOMPARE(image->property("widthChange").toInt(), 1);
+ QCOMPARE(image->property("heightChange").toInt(), 1);
image->setWidth(80.0);
+ QCOMPARE(image->property("widthChange").toInt(), 2);
+ QCOMPARE(image->property("heightChange").toInt(), 2);
QCOMPARE(image->width(), 80.);
QCOMPARE(image->height(), 80.);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
- image->setHeight(60.0);
QVERIFY(image != 0);
+ QCOMPARE(image->property("widthChange").toInt(), 1);
+ QCOMPARE(image->property("heightChange").toInt(), 1);
+ image->setHeight(60.0);
+ QCOMPARE(image->property("widthChange").toInt(), 2);
+ QCOMPARE(image->property("heightChange").toInt(), 2);
QCOMPARE(image->height(), 60.);
QCOMPARE(image->width(), 60.);
delete canvas;