-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
executable file
·53 lines (48 loc) · 1.19 KB
/
main.qml
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
42
43
44
45
46
47
48
49
50
51
52
53
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.2
import "js/Sample.js" as JS
ApplicationWindow {
title: qsTr("Qt TextArea")
width: 640
height: 480
visible: true
FileDialog {
id: fileDialog
nameFilters: [ "Text files (*.txt)" ]
onAccepted: textArea.text = JS.readFile()
}
//開くことに関するActionオブジェクト
Action {
id: openAction
text: "&Open"
shortcut: StandardKey.Open
onTriggered: fileDialog.open()
// tooltip: "Open an file"
}
menuBar: MenuBar {
Menu {
title: qsTr("&File")
MenuItem { action: openAction}
MenuItem {
text: qsTr("&Exit")
onTriggered: Qt.quit();
}
}
Menu {
title: qsTr("&Help")
MenuItem {
text: qsTr("&Version")
}
}
}
TextArea{
id: textArea
anchors.bottom: parent.bottom
y: partition
width: parent.width
height: parent.height
}
}