summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-04-12 00:00:00 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-04-12 00:01:21 (GMT)
commit04de70b0510365d32bc8fab9101dc51c01536ba9 (patch)
tree23de0c536376f24e0d080e50d106e9eac68799bf /tests/auto
parent9a05223ea9a6ee0dbaac256607be201ea08e6fb6 (diff)
downloadQt-04de70b0510365d32bc8fab9101dc51c01536ba9.zip
Qt-04de70b0510365d32bc8fab9101dc51c01536ba9.tar.gz
Qt-04de70b0510365d32bc8fab9101dc51c01536ba9.tar.bz2
Fix graphicswidget auto-test.
Reviewed-by:Michael Brasser
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml85
-rw-r--r--tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp7
2 files changed, 40 insertions, 52 deletions
diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
index c00173d..714ae7c 100644
--- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
+++ b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
@@ -1,58 +1,49 @@
import Qt 4.6
import Qt.widgets 4.6
-QGraphicsView {
- objectName: "GView"
- size: "800x600"
-
- QGraphicsScene {
- objectName: "GScene"
- sceneRect: "0,0,500x300"
-
+QGraphicsWidget {
+ layout: QGraphicsLinearLayout {
+ orientation: Qt.Horizontal
QGraphicsWidget {
layout: QGraphicsLinearLayout {
- orientation: Qt.Horizontal
- QGraphicsWidget {
- layout: QGraphicsLinearLayout {
- spacing: 10; orientation: Qt.Vertical
- LayoutItem {
- QGraphicsLinearLayout.stretchFactor: 1
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
- }
- LayoutItem {
- QGraphicsLinearLayout.stretchFactor: 10
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "blue"; anchors.fill: parent }
- }
- }
+ spacing: 10; orientation: Qt.Vertical
+ LayoutItem {
+ QGraphicsLinearLayout.stretchFactor: 1
+ objectName: "left"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
}
- QGraphicsWidget {
- layout: QGraphicsLinearLayout {
- spacing: 10; orientation: Qt.Vertical
- LayoutItem {
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "red"; anchors.fill: parent }
- }
- LayoutItem {
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "green"; anchors.fill: parent }
- }
- }
+ LayoutItem {
+ QGraphicsLinearLayout.stretchFactor: 10
+ objectName: "left"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { objectName: "yellowRect"; color: "blue"; anchors.fill: parent }
+ }
+ }
+ }
+ QGraphicsWidget {
+ layout: QGraphicsLinearLayout {
+ spacing: 10; orientation: Qt.Vertical
+ LayoutItem {
+ objectName: "left"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { objectName: "yellowRect"; color: "red"; anchors.fill: parent }
+ }
+ LayoutItem {
+ objectName: "left"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { objectName: "yellowRect"; color: "green"; anchors.fill: parent }
}
}
}
}
}
+
diff --git a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp b/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp
index a85ceed..f1a71d5 100644
--- a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp
+++ b/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp
@@ -42,7 +42,7 @@
#include <QFile>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtGui/qgraphicsview.h>
+#include <QtGui/qgraphicswidget.h>
class tst_graphicswidgets : public QObject
@@ -63,12 +63,9 @@ void tst_graphicswidgets::widgets()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/graphicswidgets.qml"));
- QGraphicsView *obj = qobject_cast<QGraphicsView*>(c.create());
+ QGraphicsWidget *obj = qobject_cast<QGraphicsWidget*>(c.create());
QVERIFY(obj != 0);
- QVERIFY(obj->scene() != 0);
- QList<QObject*> list;
- QVERIFY(obj->scene()->children() != list);
delete obj;
}