forked from Konstantin2/CallMyPhone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLastcalls.qml
71 lines (65 loc) · 1.93 KB
/
Lastcalls.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import QtQuick 2.4
LastcallsForm {
btn_1.onClicked: {
send_key('1');
phonenumber.text += '1';
}
btn_2.onClicked: {
send_key('2')
phonenumber.text += '2';
}
btn_3.onClicked: {
send_key('3')
phonenumber.text += '3';
}
btn_4.onClicked: {
send_key('4')
phonenumber.text += '4';
}
btn_5.onClicked: {
send_key('5')
phonenumber.text += '5';
}
btn_6.onClicked: {
send_key('6')
phonenumber.text += '6';
}
btn_7.onClicked: {
send_key('7')
phonenumber.text += '7';
}
btn_8.onClicked: {
send_key('8')
phonenumber.text += '8';
}
btn_9.onClicked: {
send_key('9')
phonenumber.text += '9';
}
btn_asterisk.onClicked: {
send_key('*')
phonenumber.text += '*';
}
btn_0.onClicked: {
send_key('0')
phonenumber.text += '0';
}
btn_hash.onClicked: {
send_key('#')
phonenumber.text += '#';
}
//lastcallsModel: lastcallsModel
// property alias listModel: listModel
lastcalls_listView.onCurrentItemChanged: {
// console.log(listModel.get(lastcalls_listView.currentIndex).number + ' selected')
if (lastcalls_listView.first_load === "false") {
lastcalls_listView.first_load = "true";
lastcalls_listView.currentIndex = -1; //Исправляет косяк 0-го элемента его не выбрать без этого
} else {
if (lastcalls_listView.currentIndex >= 0){
phonenumber.text = listModel.get(lastcalls_listView.currentIndex).number || ""; //Загружаем вызываемый номер
phonenumber.phone_name = listModel.get(lastcalls_listView.currentIndex).name || qsTr("Не указан"); //Загружаем ФИО вызываемого номер если указано
}
}
}
}