-
Notifications
You must be signed in to change notification settings - Fork 1
/
MessageBox.qml
47 lines (38 loc) · 1.03 KB
/
MessageBox.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
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
Popup {
id: msgBox
property alias content: content
anchors.centerIn: parent
property alias title: title.text
property alias msg: msg.text
property alias icon: msg.text
property string mode
readonly property string mode_error: "error"
readonly property string mode_information: "information"
readonly property string mode_warning: "warning"
readonly property string mode_password: "password"
readonly property string mode_question: "question"
Page {
header: Label {
id: title
}
GridLayout {
id: content
anchors.fill: parent
Button {
id: msg
flat: true
onClicked: msgBox.close()
icon.name: "dialog-" + mode
}
}
}
function show(amode, atitle, amsg) {
msgBox.mode = amode;
msgBox.title = atitle;
msgBox.msg = amsg;
open();
}
}