Skip to content

Commit 7a3c4f7

Browse files
committed
Add test for Qt.labs.platform
1 parent 0b49751 commit 7a3c4f7

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

test/labsplatform.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using QML
2+
using Test
3+
4+
qmlfile = joinpath(dirname(@__FILE__), "qml", "labsplatform.qml")
5+
loadqml(qmlfile)
6+
exec()

test/qml/labsplatform.qml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import QtQuick
2+
import QtQuick.Controls
3+
import Qt.labs.platform
4+
5+
ApplicationWindow {
6+
visible: true
7+
width: 320
8+
height: 240
9+
10+
MouseArea {
11+
anchors.fill: parent
12+
acceptedButtons: Qt.RightButton
13+
onClicked: zoomMenu.open()
14+
}
15+
16+
Menu {
17+
id: zoomMenu
18+
19+
MenuItem {
20+
text: qsTr("Zoom In")
21+
shortcut: StandardKey.ZoomIn
22+
onTriggered: zoomIn()
23+
}
24+
25+
MenuItem {
26+
text: qsTr("Zoom Out")
27+
shortcut: StandardKey.ZoomOut
28+
onTriggered: zoomOut()
29+
}
30+
}
31+
32+
Timer {
33+
interval: 1000; running: true; repeat: false
34+
onTriggered: Qt.exit(0)
35+
}
36+
}

0 commit comments

Comments
 (0)