Give the example Loader in the shared launcher focus.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Wed, 20 Jun 2012 00:13:29 +0000 (10:13 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 05:45:20 +0000 (07:45 +0200)
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 <alan.alpert@nokia.com>

examples/shared/LauncherList.qml

index 492290d..85e39a5 100644 (file)
@@ -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
         }