aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shared/LauncherList.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/shared/LauncherList.qml')
-rw-r--r--examples/quick/shared/LauncherList.qml11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml
index 65dec0f29f..e532b53e7f 100644
--- a/examples/quick/shared/LauncherList.qml
+++ b/examples/quick/shared/LauncherList.qml
@@ -57,10 +57,12 @@ Rectangle {
//function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments
color: "#eee"
- function addExample(name, desc, url)
- {
+ function addExample(name, desc, url) {
myModel.append({"name":name, "description":desc, "url":url})
}
+ function showExample(url) {
+ pageComponent.createObject(pageContainer, { exampleUrl: url }).show()
+ }
// The container rectangle here is used to give a nice "feel" when
// transitioning into an example.
@@ -72,10 +74,7 @@ Rectangle {
id: launcherList
clip: true
delegate: SimpleLauncherDelegate{
- onClicked: {
- var page = pageComponent.createObject(pageContainer, { exampleUrl: url })
- page.show()
- }
+ onClicked: showExample(url)
}
model: ListModel {id:myModel}
anchors.fill: parent