From b1009a800f4e64b17e19e578deedaf0c9bd18902 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 4 Jun 2013 15:42:16 -0400 Subject: Add qml example for UnityMenuModel --- examples/unityqmlmenumodel.qml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 examples/unityqmlmenumodel.qml (limited to 'examples/unityqmlmenumodel.qml') diff --git a/examples/unityqmlmenumodel.qml b/examples/unityqmlmenumodel.qml new file mode 100644 index 0000000..257866d --- /dev/null +++ b/examples/unityqmlmenumodel.qml @@ -0,0 +1,34 @@ + +import QtQuick 2.0 +import QMenuModel 0.1 + +Item { + width: 400; + height: 500; + + UnityMenuModel { + id: menu + busName: "com.canonical.testmenu" + actionObjectPath: "/com/canonical/testmenu" + menuObjectPath: "/com/canonical/testmenu" + } + + ListView { + anchors.fill: parent + 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 + } + } + } +} -- cgit v1.2.3