Changeset View
Changeset View
Standalone View
Standalone View
tests/khotnewstuff_test-ui/main.qml
- This file was added.
1 | import QtQuick 2.7 | ||||
---|---|---|---|---|---|
2 | import org.kde.kirigami 2.4 as Kirigami | ||||
3 | | ||||
4 | Kirigami.ApplicationWindow { | ||||
5 | id: root; | ||||
6 | | ||||
7 | globalDrawer: Kirigami.GlobalDrawer { | ||||
8 | title: "KNewStuff Test" | ||||
9 | titleIcon: "applications-development" | ||||
10 | drawerOpen: true; | ||||
11 | modal: false; | ||||
12 | | ||||
13 | actions: [ | ||||
14 | Kirigami.Action { | ||||
15 | text: "Run Engine test" | ||||
16 | onTriggered: testObject.engineTest(); | ||||
17 | iconName: "run-build" | ||||
18 | }, | ||||
19 | Kirigami.Action { | ||||
20 | text: "Test entry download as well" | ||||
21 | onTriggered: testObject.testAll = !testObject.testAll | ||||
22 | iconName: typeof(testObject) !== "undefined" ? (testObject.testAll ? "checkmark" : "") : "" | ||||
23 | }, | ||||
24 | Kirigami.Action {}, | ||||
25 | Kirigami.Action { | ||||
26 | text: "Run Entry test" | ||||
27 | onTriggered: testObject.entryTest(); | ||||
28 | iconName: "run-build" | ||||
29 | }, | ||||
30 | Kirigami.Action { | ||||
31 | text: "Run Provider test" | ||||
32 | onTriggered: testObject.providerTest(); | ||||
33 | iconName: "run-build" | ||||
34 | } | ||||
35 | ] | ||||
36 | } | ||||
37 | contextDrawer: Kirigami.ContextDrawer { | ||||
38 | id: contextDrawer | ||||
39 | } | ||||
40 | | ||||
41 | pageStack.initialPage: mainPageComponent | ||||
42 | | ||||
43 | Component { | ||||
44 | id: mainPageComponent | ||||
45 | Kirigami.ScrollablePage { | ||||
46 | title: "Welcome" | ||||
47 | ListView { | ||||
48 | id: messageView; | ||||
49 | model: testObject.messages(); | ||||
50 | onCountChanged: { | ||||
51 | messageView.currentIndex = messageView.count - 1; | ||||
52 | } | ||||
53 | delegate: Kirigami.BasicListItem { | ||||
54 | id: listItem | ||||
55 | | ||||
56 | reserveSpaceForIcon: true | ||||
57 | label: model.display | ||||
58 | icon: model.whatsThis | ||||
59 | | ||||
60 | Accessible.role: Accessible.MenuItem | ||||
61 | onClicked: {} | ||||
62 | highlighted: focus && ListView.isCurrentItem | ||||
63 | } | ||||
64 | } | ||||
65 | } | ||||
66 | } | ||||
67 | } |