From fa5da73d3f72921a1714723d2b9794c1c29882b8 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 20 Jun 2012 10:13:29 +1000 Subject: Give the example Loader in the shared launcher focus. Allows an example to receive focus the same as if it were the root item in a scene. Change-Id: Iedd31236db50ba985aebe3bd82a5af8803dc0f17 Reviewed-by: Alan Alpert --- examples/shared/LauncherList.qml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/shared/LauncherList.qml b/examples/shared/LauncherList.qml index 492290dc3e..85e39a56f1 100644 --- a/examples/shared/LauncherList.qml +++ b/examples/shared/LauncherList.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -ListView { +Item { //model is a list of {"name":"somename", "url":"file:///some/url/mainfile.qml"} //function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments function addExample(name, desc, url) @@ -51,9 +51,13 @@ ListView { ei.visible = false; } - clip: true - delegate: SimpleLauncherDelegate{exampleItem: ei} - model: ListModel {id:myModel} + ListView { + clip: true + delegate: SimpleLauncherDelegate{exampleItem: ei} + model: ListModel {id:myModel} + anchors.fill: parent + } + Item { id: ei visible: false @@ -73,6 +77,7 @@ ListView { //Eats mouse events } Loader{ + focus: true source: ei.exampleUrl anchors.fill: parent } -- cgit v1.2.3