Add sample qml application
[staging/HomeScreen.git] / sample-qml / imports / system / App.qml
1 /* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
2  *
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6  
7 import QtQuick 2.0
8 import system 1.0
9
10 FocusScope {
11     id: root
12     property string appId
13     width: 1080
14     height: 1920
15     visible: true
16     property bool hasKeyFocus: false
17     focus: visible
18     onFocusChanged: if (focus) hasKeyFocus = true
19
20     Rectangle{
21         anchors.fill: parent
22         color: 'black'
23     }
24
25     Keys.onPressed: {
26         switch (event.key) {
27         case Qt.Key_Left:
28         case Qt.Key_Right:
29             root.hasKeyFocus = false
30             break
31         default:
32             break
33         }
34     }
35 }