From d7b2243919979f9d9a0e887906b8893b9be161611f2320dfdea00e73a17eddbb Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Tue, 12 Nov 2024 15:42:21 +0100 Subject: [PATCH] AddCustomer GUI created --- doc/{ => GUI-Mockups}/GUI-AddCustomer.pdf | Bin doc/{ => GUI-Mockups}/GUI-AddCustomer.rnote | Bin doc/{ => GUI-Mockups}/GUI-Filter.pdf | Bin doc/{ => GUI-Mockups}/GUI-Filter.rnote | Bin doc/{ => GUI-Mockups}/GUI-FirstStart.pdf | Bin doc/{ => GUI-Mockups}/GUI-FirstStart.rnote | Bin doc/{ => GUI-Mockups}/GUI-Kunden.pdf | Bin doc/{ => GUI-Mockups}/GUI-Kunden.rnote | Bin doc/{ => GUI-Mockups}/GUI-Mitarbeiter.pdf | Bin doc/{ => GUI-Mockups}/GUI-Mitarbeiter.rnote | Bin doc/{ => GUI-Mockups}/GUI-Objekt.pdf | Bin doc/{ => GUI-Mockups}/GUI-Objekt.rnote | Bin doc/{ => GUI-Mockups}/GUI-TemplateTopBar.pdf | Bin .../GUI-TemplateTopBar.rnote | Bin gui/AddCustomer.qml | 377 +++++++++++------- gui/CustomerTables.qml | 11 + gui/SearchBar.qml | 71 ++-- 17 files changed, 273 insertions(+), 186 deletions(-) rename doc/{ => GUI-Mockups}/GUI-AddCustomer.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-AddCustomer.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-Filter.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-Filter.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-FirstStart.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-FirstStart.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-Kunden.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-Kunden.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-Mitarbeiter.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-Mitarbeiter.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-Objekt.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-Objekt.rnote (100%) rename doc/{ => GUI-Mockups}/GUI-TemplateTopBar.pdf (100%) rename doc/{ => GUI-Mockups}/GUI-TemplateTopBar.rnote (100%) diff --git a/doc/GUI-AddCustomer.pdf b/doc/GUI-Mockups/GUI-AddCustomer.pdf similarity index 100% rename from doc/GUI-AddCustomer.pdf rename to doc/GUI-Mockups/GUI-AddCustomer.pdf diff --git a/doc/GUI-AddCustomer.rnote b/doc/GUI-Mockups/GUI-AddCustomer.rnote similarity index 100% rename from doc/GUI-AddCustomer.rnote rename to doc/GUI-Mockups/GUI-AddCustomer.rnote diff --git a/doc/GUI-Filter.pdf b/doc/GUI-Mockups/GUI-Filter.pdf similarity index 100% rename from doc/GUI-Filter.pdf rename to doc/GUI-Mockups/GUI-Filter.pdf diff --git a/doc/GUI-Filter.rnote b/doc/GUI-Mockups/GUI-Filter.rnote similarity index 100% rename from doc/GUI-Filter.rnote rename to doc/GUI-Mockups/GUI-Filter.rnote diff --git a/doc/GUI-FirstStart.pdf b/doc/GUI-Mockups/GUI-FirstStart.pdf similarity index 100% rename from doc/GUI-FirstStart.pdf rename to doc/GUI-Mockups/GUI-FirstStart.pdf diff --git a/doc/GUI-FirstStart.rnote b/doc/GUI-Mockups/GUI-FirstStart.rnote similarity index 100% rename from doc/GUI-FirstStart.rnote rename to doc/GUI-Mockups/GUI-FirstStart.rnote diff --git a/doc/GUI-Kunden.pdf b/doc/GUI-Mockups/GUI-Kunden.pdf similarity index 100% rename from doc/GUI-Kunden.pdf rename to doc/GUI-Mockups/GUI-Kunden.pdf diff --git a/doc/GUI-Kunden.rnote b/doc/GUI-Mockups/GUI-Kunden.rnote similarity index 100% rename from doc/GUI-Kunden.rnote rename to doc/GUI-Mockups/GUI-Kunden.rnote diff --git a/doc/GUI-Mitarbeiter.pdf b/doc/GUI-Mockups/GUI-Mitarbeiter.pdf similarity index 100% rename from doc/GUI-Mitarbeiter.pdf rename to doc/GUI-Mockups/GUI-Mitarbeiter.pdf diff --git a/doc/GUI-Mitarbeiter.rnote b/doc/GUI-Mockups/GUI-Mitarbeiter.rnote similarity index 100% rename from doc/GUI-Mitarbeiter.rnote rename to doc/GUI-Mockups/GUI-Mitarbeiter.rnote diff --git a/doc/GUI-Objekt.pdf b/doc/GUI-Mockups/GUI-Objekt.pdf similarity index 100% rename from doc/GUI-Objekt.pdf rename to doc/GUI-Mockups/GUI-Objekt.pdf diff --git a/doc/GUI-Objekt.rnote b/doc/GUI-Mockups/GUI-Objekt.rnote similarity index 100% rename from doc/GUI-Objekt.rnote rename to doc/GUI-Mockups/GUI-Objekt.rnote diff --git a/doc/GUI-TemplateTopBar.pdf b/doc/GUI-Mockups/GUI-TemplateTopBar.pdf similarity index 100% rename from doc/GUI-TemplateTopBar.pdf rename to doc/GUI-Mockups/GUI-TemplateTopBar.pdf diff --git a/doc/GUI-TemplateTopBar.rnote b/doc/GUI-Mockups/GUI-TemplateTopBar.rnote similarity index 100% rename from doc/GUI-TemplateTopBar.rnote rename to doc/GUI-Mockups/GUI-TemplateTopBar.rnote diff --git a/gui/AddCustomer.qml b/gui/AddCustomer.qml index 9c6bddb..fef64ad 100644 --- a/gui/AddCustomer.qml +++ b/gui/AddCustomer.qml @@ -2,221 +2,298 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls -RowLayout +ColumnLayout { - ColumnLayout + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 15 + Label { - RowLayout - { - Label - { - text: "Firmenname" - Layout.alignment: Qt.AlignRight - - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "Street" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "PLZ" - } - ComboBox - { - - } - } - RowLayout - { - Label - { - text: "Ort" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "Telefon" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "E-Mail" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "Homepage" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "Geschäftsführer" - } - TextField - { - - } - } - RowLayout - { - Label - { - text: "USt-IdNr" - } - TextField - { - - } - } - + text: qsTr("Kunden anlegen") + horizontalAlignment: Text.AlignHCenter + Layout.fillWidth: true + font.pixelSize: 35 + } + CheckBox + { + text: qsTr("Ansprechpartner hinzufügen") + Layout.alignment: Qt.AlignRight + checked: false + onCheckStateChanged: addContactLayout.visible = checked } - ColumnLayout + RowLayout { - RowLayout + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 45 + GridLayout { + columns: 2 + Layout.fillWidth: true + Layout.fillHeight: true + rowSpacing: 9 + Label { - text: "Firmenname" + text: qsTr("Firmenname") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + id: firmenName + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + } + + Label + { + text: qsTr("Straße") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + id: street + Layout.fillWidth: true + } + Label + { + text: qsTr("PLZ") Layout.alignment: Qt.AlignRight + } + ComboBox + { + Layout.fillWidth: true + } + + Label + { + text: qsTr("Ort") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } TextField { - + id: location + Layout.fillWidth: true } - } - RowLayout - { + Label { - text: "Street" + text: qsTr("Telefon") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } TextField { - + id: telephone + Layout.fillWidth: true } - } - RowLayout - { + Label { - text: "PLZ" + text: qsTr("E-Mail") + Layout.alignment: Qt.AlignRight + } + TextField + { + id: email + Layout.fillWidth: true + } + + Label + { + text: qsTr("Homepage") + Layout.alignment: Qt.AlignRight + } + TextField + { + id: homepage + Layout.fillWidth: true + } + + Label + { + text: qsTr("Geschäftsführer") + Layout.alignment: Qt.AlignRight + } + TextField + { + id: ceo + Layout.fillWidth: true + } + + Label + { + text: qsTr("USt-IdNr") + Layout.alignment: Qt.AlignRight + } + TextField + { + id: taxno + Layout.fillWidth: true + } + Label + { + text: qsTr("Info") + Layout.alignment: Qt.AlignRight | Qt.AlignTop + } + ScrollView + { + Layout.fillWidth: true + Layout.preferredHeight: 100 + TextArea + { + id: customerInfo + background: Rectangle + { + color: palette.base + border.color: customerInfo.activeFocus? palette.highlight: palette.base + } + } + } + + + } + + GridLayout + { + id: addContactLayout + Layout.fillWidth: true + Layout.fillHeight: true + columns: 2 + rowSpacing: 9 + visible: false + + Label + { + text: qsTr("Anrede") + Layout.alignment: Qt.AlignRight } ComboBox { - + id: title + Layout.fillWidth: true } - } - RowLayout - { Label { - text: "Ort" + text: qsTr("Vorname") + Layout.alignment: Qt.AlignRight } TextField { - + id: firstname + Layout.fillWidth: true } - } - RowLayout - { + Label { - text: "Telefon" + text: qsTr("Nachname") + Layout.alignment: Qt.AlignRight } TextField { - + id: lastname + Layout.fillWidth: true } - } - RowLayout - { Label { - text: "E-Mail" + text: qsTr("Position") + Layout.alignment: Qt.AlignRight + } + ComboBox + { + id: jobdescription + Layout.fillWidth: true + } + Label + { + text: qsTr("E-Mail") + Layout.alignment: Qt.AlignRight } TextField { - + id: emailcontact + Layout.fillWidth: true } - } - RowLayout - { + Label { - text: "Homepage" + text: qsTr("Telefon") + Layout.alignment: Qt.AlignRight } TextField { - + id: telephonecontact + Layout.fillWidth: true } - } - RowLayout - { Label { - text: "Geschäftsführer" + text: qsTr("Geburtsdatum") + Layout.alignment: Qt.AlignRight } TextField { - + id: birthday + Layout.fillWidth: true } - } - RowLayout - { + Label { - text: "USt-IdNr" + text: qsTr("Priorität") + Layout.alignment: Qt.AlignRight } - TextField + ComboBox { - + id: rank + Layout.fillWidth: true } + + Label + { + text: qsTr("Info") + Layout.alignment: Qt.AlignRight | Qt.AlignTop + } + ScrollView + { + Layout.fillWidth: true + Layout.preferredHeight: 100 + TextArea + { + id: contactInfo + background: Rectangle + { + color: palette.base + border.color: contactInfo.activeFocus? palette.highlight: palette.base + } + } + } + Item + { + height: birthday.height + } + } + } + RowLayout + { + Layout.fillHeight: true + Layout.alignment: Qt.AlignRight + Button + { + text: qsTr("Abbrechen") + onClicked: appLoader.source = "CustomerTables.qml" + + } + Button + { + text: qsTr("Speichern") + } } Item { - id: spacer + id: spacer3 Layout.fillHeight: true } } diff --git a/gui/CustomerTables.qml b/gui/CustomerTables.qml index 08ef564..4cf81f6 100644 --- a/gui/CustomerTables.qml +++ b/gui/CustomerTables.qml @@ -14,6 +14,17 @@ Item { anchors.margins: 9 } + Button + { + id: addBusinessBtn + icon.source: "../images/addbusiness.svg" + icon.color: "olive" + anchors.right: parent.right + flat: true + onClicked: appLoader.source = "AddCustomer.qml" + } + + ColumnLayout { id: tableColumn diff --git a/gui/SearchBar.qml b/gui/SearchBar.qml index e3e5ee4..0b8a220 100644 --- a/gui/SearchBar.qml +++ b/gui/SearchBar.qml @@ -3,10 +3,10 @@ import QtQuick.Controls import QtQuick.Layouts -Item +RowLayout { id: searchBar - height: 30 + TextField { @@ -14,70 +14,69 @@ Item placeholderText: qsTr("Suche") leftPadding: 3 rightPadding: 3 - width: 300 + Layout.preferredWidth: 300 Button { icon.source: "../images/search.svg" icon.color: "olive" - anchors.right: parent.right + x: parent.x + parent.width - width height: parent.height flat: true } - } + Button { id: filterBtn icon.source: "../images/filter.svg" icon.color: "olive" - anchors.left: searchField.right + x: parent.x + parent.width height: searchField.height flat: true onClicked: filterPopup.open() - - } + } - Popup + Popup + { + id: filterPopup + x: filterBtn.x + filterBtn.width + y: filterBtn.y + width: 100 + height: 150 + modal: true + focus: true + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent + contentItem: Item { - id: filterPopup - x: filterBtn.x + filterBtn.width - y: filterBtn.y - width: 100 - height: 150 - modal: true - focus: true - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent - contentItem: Item + ColumnLayout { - ColumnLayout + anchors.fill: parent + //id: filterContent + + Repeater { - anchors.fill: parent - //id: filterContent + model: availableFilters - Repeater + CheckBox { - model: availableFilters - - CheckBox + text: model.modelData + onClicked: { - text: model.modelData - onClicked: - { - setFilter(text, checkState) - } + setFilter(text, checkState) } - } + } } } + } - function setFilter(filter,activated) - { - console.log(filter) - console.log(activated) + function setFilter(filter,activated) + { + console.log(filter) + console.log(activated) - } + } }