-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebtorDialog.qml
47 lines (38 loc) · 1.3 KB
/
DebtorDialog.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.7
import QtQuick.Controls 2.1
import sql.address.model 1.0
Dialog {
id: dialog
signal finished(string name, string surename, string phone, string email, string comment, int address)
function createDebtor() {
form.name.clear();
form.surename.clear();
form.phone.clear();
form.email.clear();
form.comment.clear();
form.address.currentIndex=-1;
dialog.title = qsTr("Add Debtor");
dialog.open();
}
function editDebtor(debtor) {
form.name.text = debtor.name;
form.surename.text = debtor.surename;
form.phone.text = debtor.phone;
form.email.text = debtor.email;
form.comment.text = debtor.comment;
form.address.currentIndex = debtor.address;
dialog.title = qsTr("Edit Debtor");
dialog.open();
}
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
focus: true
modal: true
title: qsTr("Add Debtor")
standardButtons: Dialog.Ok | Dialog.Cancel
contentItem: DebtorForm {
id: form
address.model: SqlAddressModel{}
}
onAccepted: finished(form.name.text, form.surename.text, form.phone.text, form.email.text, form.comment.text, form.address.currentIndex)
}