diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-05-17 03:19:13 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-05-17 03:19:13 (GMT) |
commit | 414edec537821711e22a3bb2729e189aa501bfbb (patch) | |
tree | caa1c3b4a3aa22c5670466a570f380bc3bd29355 /examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml | |
parent | cef452a2792cc15705f677c9b9c689496eeb500f (diff) | |
parent | 029f98ee0176b34279e7cc944cca17f027fe5a0a (diff) | |
download | Qt-414edec537821711e22a3bb2729e189aa501bfbb.zip Qt-414edec537821711e22a3bb2729e189aa501bfbb.tar.gz Qt-414edec537821711e22a3bb2729e189aa501bfbb.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml')
-rw-r--r-- | examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml new file mode 100644 index 0000000..fcd78d5 --- /dev/null +++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml @@ -0,0 +1,77 @@ +import Qt 4.7 +import GraphicsLayouts 4.7 + +Item { + id: resizable + + width: 800 + height: 400 + + QGraphicsWidget { + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsLinearLayout { + LayoutItem { + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + } + } + QGraphicsWidget { + x: parent.width/2 + size.width: parent.width/2 + size.height: parent.height + + layout: QGraphicsGridLayout { + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { color: "red"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "100x100" + Rectangle { color: "orange"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 2 + QGraphicsGridLayout.column: 0 + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "200x200" + Rectangle { color: "yellow"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 0 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "200x200" + preferredSize: "200x200" + Rectangle { color: "green"; anchors.fill: parent } + } + LayoutItem { + QGraphicsGridLayout.row: 1 + QGraphicsGridLayout.column: 1 + minimumSize: "100x100" + maximumSize: "400x400" + preferredSize: "200x200" + Rectangle { color: "blue"; anchors.fill: parent } + } + } + } +} |