aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-06-04 21:05:40 -0400
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-06-04 21:05:40 -0400
commit00885c1ddd04819c44d6a0ca2c7f2af8a1298a97 (patch)
tree049e560e1c7086d0cbf045a647b47e8c588e813c /examples
parent2a01b1cba8af5891bac632683286951e2c3f95f0 (diff)
downloadqmenumodel-00885c1ddd04819c44d6a0ca2c7f2af8a1298a97.tar.gz
qmenumodel-00885c1ddd04819c44d6a0ca2c7f2af8a1298a97.tar.bz2
qmenumodel-00885c1ddd04819c44d6a0ca2c7f2af8a1298a97.zip
unitymenumodel: expose isSeparator
Diffstat (limited to 'examples')
-rw-r--r--examples/unityqmlmenumodel.qml37
1 files changed, 27 insertions, 10 deletions
diff --git a/examples/unityqmlmenumodel.qml b/examples/unityqmlmenumodel.qml
index 257866d..d38d6e5 100644
--- a/examples/unityqmlmenumodel.qml
+++ b/examples/unityqmlmenumodel.qml
@@ -18,16 +18,33 @@ Item {
anchors.margins: 10
spacing: 3
model: menu
- delegate: Rectangle {
- width: parent.width
- height: 40
- color: "#ddd"
- Text {
- anchors.fill: parent
- anchors.margins: 5
- verticalAlignment: Text.AlignVCenter
- color: sensitive ? "black" : "#aaa";
- text: label
+
+ delegate: Loader {
+ sourceComponent: isSeparator ? separator : menuitem;
+
+ Component {
+ id: separator
+ Rectangle {
+ width: parent.width
+ height: 4
+ color: "blue"
+ }
+ }
+
+ Component {
+ id: menuitem
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#ddd"
+ Text {
+ anchors.fill: parent
+ anchors.margins: 5
+ verticalAlignment: Text.AlignVCenter
+ color: sensitive ? "black" : "#aaa";
+ text: label
+ }
+ }
}
}
}