-
Notifications
You must be signed in to change notification settings - Fork 3
/
MainPage.qml
39 lines (32 loc) · 994 Bytes
/
MainPage.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
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
import QtQml.Models 2.2
import iproapps.besttodolist 1.0
MainPageForm {
toolButton.onClicked: {
newTaskInputRowId.visible = true;
toDoTextField.enabled = true;
toolButton.visible = false;
toDoTextField.forceActiveFocus();
}
TaskListDelegateModel {
id: delegateModelId
visualModel.model: backend.newTaskModel
listView: parent.listView
}
listView.model: delegateModelId.visualModel
listView.spacing: 4
createTaskButtonId.onClicked: {
var textValue = toDoTextField.text.trim();
if (textValue === "")
return;
toDoTextField.enabled = false;
toDoTextField.text = "";
newTaskInputRowId.visible = false;
toolButton.visible = true;
Qt.inputMethod.hide()
backend.newTask(textValue, colorPickerId.selectedColor);
listView.positionViewAtBeginning()
}
}