GUI Object
This commit is contained in:
116
Gui/AddObject.qml
Normal file
116
Gui/AddObject.qml
Normal file
@@ -0,0 +1,116 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Dialogs
|
||||
import "../js/qmldict.js" as JsLib
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
property var new_object: null
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 15
|
||||
Label
|
||||
{
|
||||
text: qsTr("Objekt anlegen")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 35
|
||||
}
|
||||
CheckBox
|
||||
{
|
||||
id: checkAddObject
|
||||
text: qsTr("Mitarbeiter/Ansprechpartner hinzufügen")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
checked: false
|
||||
onCheckStateChanged:
|
||||
{
|
||||
addObjectLayout.visible = checked
|
||||
//checkFields()
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
id: addobject
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 45
|
||||
|
||||
ObjectView
|
||||
{
|
||||
id: objectView
|
||||
}
|
||||
|
||||
ObjectAddOns
|
||||
{
|
||||
id: addObjectLayout
|
||||
}
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Button
|
||||
{
|
||||
text: qsTr("Abbrechen")
|
||||
onClicked: appLoader.source = "ObjectTable.qml"
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: saveBtn
|
||||
text: qsTr("Speichern")
|
||||
enabled: false
|
||||
onClicked:
|
||||
{
|
||||
if (!checkAddObject.checked)
|
||||
{
|
||||
new_object = JsLib.addObject(objectView)
|
||||
object_model.addObject(new_object, 0)
|
||||
appLoader.source = "ObjectTable.qml"
|
||||
}
|
||||
else
|
||||
{
|
||||
new_object = JsLib.addObject(objectView)
|
||||
var new_objecto = JsLib.addObject(addObjectLayout)
|
||||
objecto_model.addObject(new_objecto)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: spacer3
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Connections
|
||||
// {
|
||||
// target: spacer3
|
||||
|
||||
// function onObjectIdReady()
|
||||
// {
|
||||
// var obj_id = arguments[0]
|
||||
// object_model.addObject(new_object, obj_id)
|
||||
// appLoader.source = "ObjectTable.qml"
|
||||
// }
|
||||
// }
|
||||
|
||||
// function checkFields()
|
||||
// {
|
||||
// if(checkAddObject.checked)
|
||||
// {
|
||||
// if(!objectView.checkObjectField() || !addObjectLayout.checkObjectField())
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
// else if (!objectView.checkObjectField())
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
}
|
||||
98
Gui/AddObjectEmployee.qml
Normal file
98
Gui/AddObjectEmployee.qml
Normal file
@@ -0,0 +1,98 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
Window
|
||||
{
|
||||
id: addmitarbeiter
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
Label
|
||||
{
|
||||
text: qsTr("Neuer Mitarbeiter")
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
GridLayout
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
columns: 2
|
||||
rowSpacing: 4
|
||||
columnSpacing: 6
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Eingesetzter Mitarbeiter")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Lohn Mitarbeiter pro Stunde")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Einsatzdauer")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Reinigungstage")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Tätigkeiten")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Ertrag")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
spacing: 5
|
||||
Item
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: qsTr("Abbrechen")
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: qsTr("Hinzufügen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Gui/ObjectAddOnContactPerson.qml
Normal file
89
Gui/ObjectAddOnContactPerson.qml
Normal file
@@ -0,0 +1,89 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
GridLayout
|
||||
{
|
||||
columns: 2
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: contactperson
|
||||
text: qsTr("Ansprechpartner")
|
||||
Layout.columnSpan: 2
|
||||
onCheckStateChanged:
|
||||
{
|
||||
title.enabled = contactperson.checked
|
||||
firstname.enabled = contactperson.checked
|
||||
lastname.enabled = contactperson.checked
|
||||
phonenumber.enabled = contactperson.checked
|
||||
posizion.enabled = contactperson.checked
|
||||
}
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Anrede")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
ComboBox
|
||||
{
|
||||
id: title
|
||||
model: [qsTr("Herr"),qsTr("Frau")]
|
||||
Layout.fillWidth: true
|
||||
enabled: false
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Vorname")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: firstname
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
enabled: false
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Nachname")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: lastname
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
enabled: false
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Telefonnummer")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: phonenumber
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
enabled: false
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr("Position")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: posizion
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
enabled: false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
55
Gui/ObjectAddOnEmployee.qml
Normal file
55
Gui/ObjectAddOnEmployee.qml
Normal file
@@ -0,0 +1,55 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
GridLayout
|
||||
{
|
||||
id: oaoemployee
|
||||
columns: 2
|
||||
rows: 4
|
||||
Label
|
||||
{
|
||||
text: qsTr("Mitarbeiter")
|
||||
}
|
||||
ScrollView
|
||||
{
|
||||
Layout.rowSpan: 3
|
||||
Layout.fillWidth: true
|
||||
|
||||
TextArea
|
||||
{
|
||||
id: mitarbeitertext
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: 100
|
||||
wrapMode: TextEdit.Wrap
|
||||
background: Rectangle
|
||||
{
|
||||
color: mitarbeiterhin.palette.base
|
||||
border.color: mitarbeiterhin.activeFocus? mitarbeiterhin.palette.highlight: mitarbeiterhin.palette.base
|
||||
}
|
||||
}
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: mitarbeiterhin
|
||||
property var neuermitarbeiter: undefined
|
||||
text: qsTr("Mitarbeiter hinzufügen")
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.maximumWidth: mitarbeitertext.width
|
||||
onClicked:
|
||||
{
|
||||
var nm = Qt.createComponent("AddObjectEmployee.qml")
|
||||
if (nm.status === Component.Ready)
|
||||
{
|
||||
neuermitarbeiter = nm.createObject (appWindow, {width: 600, height: 400})
|
||||
neuermitarbeiter.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
21
Gui/ObjectAddOns.qml
Normal file
21
Gui/ObjectAddOns.qml
Normal file
@@ -0,0 +1,21 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: addObjectLayout
|
||||
visible: false
|
||||
|
||||
ObjectAddOnEmployee
|
||||
{
|
||||
id: oaoemployee
|
||||
}
|
||||
ObjectAddOnContactPerson
|
||||
{
|
||||
id: oaocontactperson
|
||||
}
|
||||
Item
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
164
Gui/ObjectTable.qml
Normal file
164
Gui/ObjectTable.qml
Normal file
@@ -0,0 +1,164 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
import QtQuick.Controls.Fusion
|
||||
|
||||
Item {
|
||||
property var availableFilters: [""]
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: addObjectBtn
|
||||
icon.source: "qrc:/images/addbusiness.svg"
|
||||
icon.color: "olive"
|
||||
anchors.right: parent.right
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddObject.qml"
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: tableColumn
|
||||
anchors
|
||||
{
|
||||
top: searchBar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeaderview
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 40
|
||||
visible: false
|
||||
movableColumns: true //@disable-check M16
|
||||
syncView: objectTable
|
||||
|
||||
delegate: Rectangle {
|
||||
color: addObjectBtn.palette.alternateBase
|
||||
border.color: addObjectBtn.palette.base
|
||||
implicitHeight: 40
|
||||
Layout.fillWidth: true
|
||||
implicitWidth: 1
|
||||
Text
|
||||
{
|
||||
text: model.display
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: addObjectBtn.palette.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
property real newWidth: 0
|
||||
id: objectTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
policy: objectTable.contentHeight > objectTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
}
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
//model: object_model
|
||||
alternatingRows: true
|
||||
resizableColumns: true // @disable-check M16
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
{
|
||||
id: obmodel
|
||||
model: objectTable.model
|
||||
}
|
||||
|
||||
// Timer
|
||||
// {
|
||||
// id: redrawTable
|
||||
// running: true
|
||||
// interval: 1
|
||||
// repeat: false
|
||||
// onTriggered:
|
||||
// {
|
||||
// objectTable.forceLayout();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: objectTable.width / objectTable.columns
|
||||
implicitHeight: 25
|
||||
color: selected
|
||||
? addObjectBtn.palette.highlight //palette.highlight
|
||||
: (objectTable.alternatingRows && row % 2 !== 0
|
||||
? addObjectBtn.palette.base // palette.base
|
||||
: addObjectBtn.palette.alternateBase) //palette.alternateBase)
|
||||
|
||||
Text
|
||||
{
|
||||
text: model.display == null? "": model.display
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: 9 //@d isable-check M16
|
||||
color: addObjectBtn.palette.text
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
property bool hovered: false
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
object_model.onRowClicked(row)
|
||||
}
|
||||
onEntered:
|
||||
{
|
||||
objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// onContentWidthChanged:
|
||||
// {
|
||||
|
||||
// redrawTable.start()
|
||||
// }
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
// function viewCriterion(criterion)
|
||||
// {
|
||||
// object_model.viewCriterion(criterion.text)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
202
Gui/ObjectView.qml
Normal file
202
Gui/ObjectView.qml
Normal file
@@ -0,0 +1,202 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
GridLayout
|
||||
{
|
||||
id: objectView
|
||||
|
||||
columns: 2
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
rowSpacing: 9
|
||||
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Objektstraße")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: objectName
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onTextChanged: checkFields()
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Leistungsort")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: leistungsortid
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
onTextChanged: checkFields()
|
||||
placeholderText: "Pflichtfeld"
|
||||
placeholderTextColor: "red"
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Lohnanteil inkl. Fahrtkosten")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: lohnanteil
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Materialanteil")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: materialanteil
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Zusatz 1")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: zusatz1
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Zusatz 2")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: zusatz2
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Gesamt Netto")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: gesamtnetto
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("MwSt")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: mwst
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Gesamt(Netto+MwSt)")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: gesamt
|
||||
Layout.fillWidth: true
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Zahlungsziel")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
ComboBox
|
||||
{
|
||||
property string name: "zahlungsziel"
|
||||
id: zahlungsziel
|
||||
Layout.fillWidth: true
|
||||
editable: false
|
||||
//model: business_type
|
||||
textRole: "display"
|
||||
//Layout.maximumWidth: parent.width / 2
|
||||
}
|
||||
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Info")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||
}
|
||||
ScrollView
|
||||
{
|
||||
id: infoview
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 200
|
||||
//Layout.columnSpan: 3
|
||||
ScrollBar.horizontal: ScrollBar
|
||||
|
||||
{
|
||||
policy: ScrollBar.AlwaysOn
|
||||
}
|
||||
|
||||
TextArea
|
||||
{
|
||||
id: objectInfo
|
||||
property string name: "objectinfo"
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
wrapMode: TextEdit.Wrap
|
||||
background: Rectangle
|
||||
{
|
||||
color: objectInfo.palette.base
|
||||
border.color: objectInfo.activeFocus? objectInfo.palette.highlight: objectInfo.palette.base
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ RowLayout
|
||||
flat: true
|
||||
text: qsTr("Objekt")
|
||||
implicitWidth: objekt.implicitContentWidth + 10
|
||||
onClicked:
|
||||
{
|
||||
appLoader.source = "ObjectTable.qml"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user