Ubuntu Pastebin

Paste from rpadovani at Tue, 12 May 2015 13:38:57 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import QtQuick 2.3
import Ubuntu.Components 1.1

MainView {
  applicationName: "com.rpadovani.wrongFocus"
  useDeprecatedToolbar: false
  width: units.gu(50); height: units.gu(75)

  PageStack {
    id: pagestack

    Component.onCompleted:{
      pagestack.push(pageFocus)
    }
  }

  Page {
    id: uselessPage
  }

  Page {
    id: pageFocus
    focus: true; title: 'f'
    Component.onCompleted:pageFocus.forceActiveFocus()

    onVisibleChanged: searchInput.forceActiveFocus();

    head {
        contents: searchInput
        backAction: Action {iconName: "close"; onTriggered: pagestack.pop()}
    }

    TextField {
        id: searchInput
        anchors {left: parent.left; right: parent.right}

        onFocusChanged: console.log('textfield focus:' + focus)
    }
  }

}
Download as text