Add remove action to records. Use popup sheet with old calendar widget to select dates.
This commit is contained in:
@@ -2,6 +2,7 @@ import QtQuick 2.9
|
|||||||
import org.kde.kirigami 2.12 as Kirigami
|
import org.kde.kirigami 2.12 as Kirigami
|
||||||
import QtQuick.Controls 2.9 as Controls
|
import QtQuick.Controls 2.9 as Controls
|
||||||
import QtQuick.Layouts 1.12 as Layouts
|
import QtQuick.Layouts 1.12 as Layouts
|
||||||
|
import QtQuick.Controls 1.4 as Old
|
||||||
|
|
||||||
Kirigami.ApplicationWindow {
|
Kirigami.ApplicationWindow {
|
||||||
id: root
|
id: root
|
||||||
@@ -223,6 +224,15 @@ Kirigami.ApplicationWindow {
|
|||||||
text: notes
|
text: notes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
actions: [
|
||||||
|
Kirigami.Action {
|
||||||
|
text: qsTr("Remove")
|
||||||
|
iconName: "edit-delete"
|
||||||
|
onTriggered: {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,11 +269,21 @@ Kirigami.ApplicationWindow {
|
|||||||
Kirigami.FormData.label: qsTr("Service Type")+":"
|
Kirigami.FormData.label: qsTr("Service Type")+":"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Layouts.RowLayout {
|
||||||
|
Kirigami.FormData.label: qsTr("Date")+":"
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
id: dateField
|
id: dateField
|
||||||
selectByMouse: true
|
text: new Date().toLocaleDateString(Qt.locale())
|
||||||
Kirigami.FormData.label: qsTr("Date")+":"
|
readOnly: true
|
||||||
inputMethodHints: Qt.ImhDate //TODO: implement better input
|
}
|
||||||
|
Controls.Button {
|
||||||
|
icon.name: "office-calendar"
|
||||||
|
text: qsTr("Select Date")
|
||||||
|
display: Controls.AbstractButton.IconOnly
|
||||||
|
onClicked: {
|
||||||
|
calendarPopup.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
@@ -302,6 +322,16 @@ Kirigami.ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Kirigami.OverlaySheet {
|
||||||
|
id: calendarPopup
|
||||||
|
Old.Calendar {
|
||||||
|
selectedDate: Date.fromLocaleDateString(Qt.locale(), dateField.text)
|
||||||
|
onClicked: {
|
||||||
|
dateField.text = date.toLocaleDateString(Qt.locale());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user