summaryrefslogtreecommitdiffstats
path: root/examples/declarative/layouts/layouts.qml
blob: 6e22d8b582b150fac3b1f649bb32fe79f0e328b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Qt 4.6

Item { id: resizable
    width:400; height:400;
    GraphicsObjectContainer{
        anchors.fill:parent
        QGraphicsWidget{
            geometry:{ "0,0," + parent.width.toString() + "x" + parent.height.toString(); }
            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 }
                }
            }
        }
    }
}