QML: Correct threading to load images
[mussorgsky] / ui / main.qml
1 import Qt 4.7
2
3 Rectangle {
4     id: screen
5     width: 800
6     height: 480
7     color: "black"
8     //state: "in_initPage"
9     state: "in_albumsPage"
10      
11     Row {
12         id: initPage
13
14         anchors.horizontalCenter : screen.horizontalCenter
15         anchors.verticalCenter: screen.verticalCenter
16         spacing: screen.width / 4
17
18         FancyButton {
19            source: "images/button-blue.png"
20            caption: "Edit metadata"
21         }
22
23         FancyButton {
24            source: "images/button-red.png"
25            caption: "Album art"
26            onClicked: {
27               screen.state = "in_albumsPage"
28            }
29         }
30     }
31
32     AlbumList {
33         id: albumsPage
34         model: albumModel
35         onRowSelected: {
36             screen.state = "in_alternativesPage"
37             missionControl.albumSelected (coversModel, album)
38         }
39     }
40
41     Alternatives {
42         id:alternativesPage
43         model: coversModel
44     }
45
46     states: [
47        State {
48            name: "in_initPage"
49            PropertyChanges {target: initPage; visible: true }
50            PropertyChanges {target: albumsPage; visible: false }
51            PropertyChanges {target: alternativesPage; visible: false }
52        },
53
54        State {
55            name: "in_albumsPage"
56            PropertyChanges {target: initPage; visible: false }
57            PropertyChanges {target: albumsPage; visible: true }
58            PropertyChanges {target: alternativesPage; visible: false }
59        },
60
61        State {
62            name: "in_alternativesPage"
63            PropertyChanges {target: initPage; visible: false }
64            PropertyChanges {target: albumsPage; visible: false }
65            PropertyChanges {target: alternativesPage; visible: true }
66        }
67     ]
68
69
70 }