Add empty QML app
This commit is contained in:
parent
b4c81fa3f9
commit
161f5681ee
7 changed files with 121 additions and 0 deletions
49
qt/main.qml
Normal file
49
qt/main.qml
Normal file
|
@ -0,0 +1,49 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
ApplicationWindow {
|
||||
visible: true
|
||||
width: 256
|
||||
height: 128
|
||||
title: qsTr("OBoy")
|
||||
|
||||
menuBar: MenuBar {
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
MenuItem {
|
||||
text: qsTr("&Open")
|
||||
onTriggered: console.log("Open action triggered");
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Exit")
|
||||
onTriggered: Qt.quit();
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
title: qsTr("View")
|
||||
MenuItem {
|
||||
text: qsTr("Background maps")
|
||||
onTriggered: console.log("Background maps");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MainForm {
|
||||
anchors.fill: parent
|
||||
button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
|
||||
button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
id: messageDialog
|
||||
title: qsTr("May I have your attention, please?")
|
||||
|
||||
function show(caption) {
|
||||
messageDialog.text = caption;
|
||||
messageDialog.open();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue