summaryrefslogtreecommitdiffstats
path: root/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml')
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml15
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml
index da77921..72cdeb6 100644
--- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml
@@ -49,17 +49,28 @@ Item {
size.width: parent.width
size.height: parent.height
+ /*
+ Below we create a linear layout using the GraphicsLinearLayout item
+ (defined by the GraphicsLinearLayoutObject class in linearlayout.h).
+
+ The first LayoutItem uses 'GraphicsLinearLayout.spacing' to set the
+ item's spacing: this is an attached property, set using the
+ properties defined in the LinearLayoutAttached class (also defined
+ in linearlayout.h).
+ */
+
layout: QGraphicsLinearLayout {
LayoutItem {
+ QGraphicsLinearLayout.spacing: 50
minimumSize: "100x100"
- maximumSize: "300x300"
+ maximumSize: "200x200"
preferredSize: "100x100"
Rectangle { color: "yellow"; anchors.fill: parent }
}
LayoutItem {
minimumSize: "100x100"
maximumSize: "400x400"
- preferredSize: "200x200"
+ preferredSize: "300x300"
Rectangle { color: "green"; anchors.fill: parent }
}
}