diff options
Diffstat (limited to 'examples/declarative/cppextensions/qgraphicslayouts/layoutItem')
3 files changed, 9 insertions, 10 deletions
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro index 4a3fc73..c85a400 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro @@ -1,13 +1,8 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Tue May 4 13:36:26 2010 -###################################################################### - TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . QT += declarative -# Input SOURCES += main.cpp RESOURCES += layoutItem.qrc diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml index 460c564..6f91dc9 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml @@ -1,15 +1,17 @@ import Qt 4.7 -LayoutItem {//Sized by the layout +LayoutItem { //Sized by the layout id: resizable + minimumSize: "100x100" maximumSize: "300x300" preferredSize: "100x100" + Rectangle { color: "yellow"; anchors.fill: parent } + Rectangle { - width: 100; height: 100; - anchors.top: parent.top; - anchors.right: parent.right; - color: "green"; + width: 100; height: 100 + anchors.top: parent.top; anchors.right: parent.right + color: "green" } } diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp index a104251..47d3a23 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp +++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp @@ -53,6 +53,7 @@ int main(int argc, char* argv[]) { QApplication app(argc, argv); + //Set up a graphics scene with a QGraphicsWidget and Layout QGraphicsView view; QGraphicsScene scene; @@ -61,6 +62,7 @@ int main(int argc, char* argv[]) widget->setLayout(layout); scene.addItem(widget); view.setScene(&scene); + //Add the QML snippet into the layout QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl(":layoutItem.qml")); |