Hello Aekold, On Wed, May 16, 2012 at 5:15 PM, Aekold Helbrass <helbr...@gmail.com> wrote: > Lame question which I cannot figure out myself: how to create reusable > container components in QML? > Here is what I have in mind: > > Rectangle { > Header { > } > > <body goes here> > > Row { > anchors.bottom: parent.bottom > anchors.right: parent.right > Button { text: "OK" } > Button { text: "Cancel" } > } > } >
If I understand your question correctly, you want to have one 'template' qml to use and everytime put a different body depending on the current interaction. You could actually create[0] a component that would have the 'header' and 'footer' as you just noted, and have a Loader[1] in its body and introduce a property from the top level 'container' that would allow you to set the Loader's source file. You could then, depending on the current state change the source property and have a different 'body' in your one template. HTH, -Sivan [0]: http://doc.qt.nokia.com/4.7-snapshot/qml-component.html [1]: http://doc.qt.nokia.com/4.7-snapshot/qml-loader.html#details _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest