summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-16 08:17:02 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-16 08:17:02 (GMT)
commit8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d (patch)
treec328303e395088f88ba721e96bd6e09a008ad581 /tests
parent71e333de0c258796a924b1d858253381d689cf19 (diff)
parentbb8142436bacf5a4fa31880b58a8b3b6bc7b4d5b (diff)
downloadQt-8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d.zip
Qt-8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d.tar.gz
Qt-8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Conflicts: src/plugins/imageformats/gif/qgifhandler.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp17
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp28
3 files changed, 68 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml
new file mode 100644
index 0000000..4a2f056
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml
@@ -0,0 +1,23 @@
+import Qt 4.7
+
+Rectangle {
+ width: 400
+ height: 200
+
+ Item {
+ objectName: "theItem"
+ anchors.centerIn: parent
+ width: childrenRect.width
+ height: childrenRect.height
+ Rectangle {
+ id: text1
+ anchors.verticalCenter: parent.verticalCenter
+ width: 100; height: 100; color: "green"
+ }
+ Rectangle {
+ anchors.left: text1.right
+ anchors.verticalCenter: parent.verticalCenter
+ width: 100; height: 100; color: "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index c2d3660..0a66245 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -72,6 +72,7 @@ private slots:
void transforms();
void transforms_data();
void childrenRect();
+ void childrenRectBug();
void childrenProperty();
void resourcesProperty();
@@ -736,6 +737,22 @@ void tst_QDeclarativeItem::childrenRect()
delete o;
}
+// QTBUG-11383
+void tst_QDeclarativeItem::childrenRectBug()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug.qml"));
+ canvas->show();
+
+ QGraphicsObject *o = canvas->rootObject();
+ QDeclarativeItem *item = o->findChild<QDeclarativeItem*>("theItem");
+ QCOMPARE(item->width(), qreal(200));
+ QCOMPARE(item->height(), qreal(100));
+ QCOMPARE(item->x(), qreal(100));
+
+ delete canvas;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
{
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 1fe1332..fe2a719 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -138,6 +138,9 @@ private slots:
void sizeBeforeRead_data();
void sizeBeforeRead();
+ void sizeBeforeFormat_data();
+ void sizeBeforeFormat();
+
void imageFormatBeforeRead_data();
void imageFormatBeforeRead();
@@ -706,6 +709,31 @@ void tst_QImageReader::sizeBeforeRead()
QCOMPARE(size, image.size());
}
+void tst_QImageReader::sizeBeforeFormat_data()
+{
+ imageFormat_data();
+}
+
+void tst_QImageReader::sizeBeforeFormat()
+{
+ QFETCH(QString, fileName);
+
+ QByteArray formatA, formatB;
+
+ {
+ QImageReader reader(prefix + fileName);
+ formatA = reader.format();
+ }
+
+ {
+ QImageReader reader(prefix + fileName);
+ QSize size = reader.size();
+ formatB = reader.format();
+ }
+
+ QCOMPARE(formatA, formatB);
+}
+
void tst_QImageReader::imageFormatBeforeRead_data()
{
imageFormat_data();