Clean up leftover files and commented code

This commit is contained in:
Yuri Becker
2025-03-25 11:39:45 +01:00
parent 7b8c3630f8
commit 445c183e71
10 changed files with 128 additions and 763 deletions

View File

@@ -1,26 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
property var availableFilters: [""]
anchors.fill: parent
StackView
{
id: objectsStack
anchors.fill: parent
initialItem: "ObjectsTable.qml"
<<<<<<< HEAD
anchors.topMargin: Dimensions.m
=======
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}
}

View File

@@ -1,26 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
property var availableFilters: [""]
anchors.fill: parent
StackView
{
id: objectsStack
anchors.fill: parent
initialItem: "ObjectsTable.qml"
<<<<<<< HEAD
anchors.topMargin: Dimensions.m
=======
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}
}

View File

@@ -1,22 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
property var availableFilters: [""]
StackView
{
id: objectsStack
anchors.fill: parent
initialItem: "ObjectsTable.qml"
anchors.margins: 9
}
}

View File

@@ -1,22 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
property var availableFilters: [""]
StackView
{
id: objectsStack
anchors.fill: parent
initialItem: "ObjectsTable.qml"
anchors.topMargin: Dimensions.m
}
}

View File

@@ -1,22 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
property var availableFilters: [""]
anchors.fill: parent
StackView
{
id: objectsStack
anchors.fill: parent
initialItem: "ObjectsTable.qml"
}
}

View File

@@ -1,257 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
<<<<<<< HEAD
ColumnLayout
{
function viewCriterion(criterion)
{
business_model.viewCriterion(criterion.text);
}
function onObjectContactAdded(added)
{
console.log(added)
if (added) object_model.viewCriterion("")
}
anchors.fill: parent
Component.onCompleted:
{
contact_model.objectContactAdded.connect(onObjectContactAdded)
objectsStack.pop()
}
RowLayout
{
SearchBar
{
}
QuickFilter {
onSelectedChanged: (name) => {
business_model.viewCriterion(name)
}
model: ListModel {
ListElement {
name: "Alle"
text: qsTr("Alle")
selected: true
}
ListElement {
name: "Interessent"
text: qsTr("Interessent")
selected: false
}
ListElement {
name: "Kunde"
text: qsTr("Kunde")
selected: false
}
ListElement {
name: "Lieferant"
text: qsTr("Lieferant")
selected: false
}
ListElement {
name: "Erledigt"
text: qsTr("Erledigt")
selected: false
}
}
}
Button
{
id: addObjectBtn
icon.source: "qrc:/images/PlusCircle.svg"
text: qsTr("Objekt Hinzufügen")
Layout.alignment: Qt.AlignRight
onClicked: appLoader.source = "AddObject.qml"
}
=======
ColumnLayout {
spacing: Dimensions.l
function onObjectContactAdded(added) {
console.log(added);
if (added)
object_model.viewCriterion("");
}
Component.onCompleted: {
contact_model.objectContactAdded.connect(onObjectContactAdded);
objectsStack.pop();
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}
RowLayout {
Layout.fillWidth: true
spacing: Dimensions.l
<<<<<<< HEAD
ColumnLayout
{
id: tableColumn
clip: true
// anchors
// {
// top: searchBar.bottom
// bottom: parent.bottom
// left: parent.left
// right: parent.right
// topMargin: 15
// }
HorizontalHeaderView
{
=======
SearchBar {
}
Button {
id: addObjectBtn
Layout.alignment: Qt.AlignRight
icon.source: "qrc:/images/PlusCircle.svg"
text: qsTr("Objekt Hinzufügen")
onClicked: appLoader.source = "AddObject.qml"
}
}
ColumnLayout {
id: tableColumn
Layout.fillWidth: true
Layout.fillHeight: true
Layout.verticalStretchFactor: 1
clip: true
HorizontalHeaderView {
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
id: horizontalHeaderview
Layout.fillWidth: true
implicitHeight: 40
movableColumns: true //@disable-check M16
syncView: objectTable
delegate: Rectangle {
Layout.fillWidth: true
border.color: addObjectBtn.palette.base
color: addObjectBtn.palette.alternateBase
implicitHeight: 40
implicitWidth: 1
Text {
color: addObjectBtn.palette.text
elide: Text.ElideRight
height: parent.height
horizontalAlignment: Text.AlignHCenter
text: model.display
verticalAlignment: Text.AlignVCenter
width: parent.width
}
}
}
TableView {
id: objectTable
property real newWidth: 0
Layout.fillWidth: true
Layout.fillHeight: true
alternatingRows: true
columnSpacing: 1
height: parent.height - horizontalHeaderview.height
model: object_model
resizableColumns: true // @disable-check M16
rowSpacing: 2
selectionBehavior: TableView.SelectRows
z: 0
ScrollBar.vertical: ScrollBar {
policy: objectTable.contentHeight > objectTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
}
delegate: Rectangle {
required property bool current
required property bool selected
color: selected ? addObjectBtn.palette.highlight
: (objectTable.alternatingRows && row % 2 !== 0 ? addObjectBtn.palette.base
: addObjectBtn.palette.alternateBase)
implicitHeight: 25
implicitWidth: objectTable.width / objectTable.columns
Text {
color: addObjectBtn.palette.text
elide: Text.ElideRight
height: parent.height
leftPadding: 9 //@disable-check M16
text: (model.display === null || model.display === undefined) ? "" : model.display
verticalAlignment: Text.AlignVCenter
width: parent.width
}
MouseArea {
id: mouseArea
property bool hovered: false
anchors.fill: parent
hoverEnabled: true
onDoubleClicked: {
objectsStack.push("ObjectDetails.qml", {
selectedObject: row
});
}
onEntered: {
objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows);
}
}
}
selectionModel: ItemSelectionModel {
id: obmodel
model: objectTable.model
}
}
<<<<<<< HEAD
}
Item
{
Layout.fillHeight: true
}
// function onObjectContactAdded(added)
// {
// console.log(added)
// if (added) object_model.viewCriterion("")
// }
// function viewCriterion(criterion)
// {
// object_model.viewCriterion(criterion.text)
// }
// Component.onCompleted:
// {
// contact_model.objectContactAdded.connect(onObjectContactAdded)
// objectsStack.pop()
// }
// function onObjectContactAdded(added)
// {
// console.log(added)
// if (added) object_model.viewCriterion("")
// }
=======
Item {
Layout.fillWidth: true
}
}
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}

View File

@@ -1,22 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item
{
anchors.fill: parent
StackView
{
id: offersStack
anchors.fill: parent
initialItem: "OffersTable.qml"
<<<<<<< HEAD
anchors.topMargin: Dimensions.m
=======
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}
}

View File

@@ -1,90 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
<<<<<<< HEAD
ColumnLayout
{
anchors.fill: parent
function viewOffers(criterion)
{
//offer_model.viewCriterion(criterion)
=======
ColumnLayout {
property var availableFilters: []
Layout.fillWidth: true
anchors.fill: parent
RowLayout {
spacing: Dimensions.l
SearchBar {
}
}
Item {
Layout.fillHeight: true
>>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d
}
RowLayout
{
SearchBar
{
id:searchBar
}
QuickFilter
{
onSelectedChanged: (name) =>
{
business_model.viewCriterion(name)
}
model: ListModel
{
ListElement
{
name: "Alle"
text: qsTr("Alle")
selected: true
}
ListElement
{
name: "Offen"
text: qsTr("Offen")
selected: false
}
ListElement
{
name: "Abgeschlossen"
text: qsTr("Abgeschlossen")
selected: false
}
ListElement
{
name: "Erledigt"
text: qsTr("Erledigt")
selected: false
}
}
}
Button
{
id: addOfferBtn
text: qsTr("Angebote Hinzufügen")
icon.source: "qrc:/images/PlusCircle.svg"
Layout.alignment: Qt.AlignRight
flat: true
//onClicked: appLoader.source = "AddOffer.qml"
}
}
Item {
id: spacer
Layout.fillHeight: true
}
}

View File

@@ -2,269 +2,159 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
ColumnLayout {
ColumnLayout
{
id: topBar id: topBar
spacing: 0
height: parent.height height: parent.height
anchors spacing: 0
{
top: parent.top anchors {
left: parent.left left: parent.left
top: parent.top
} }
ButtonGroup ButtonGroup {
{
id: buttonBar id: buttonBar
}
BarButton }
{ BarButton {
id: dashBoard id: dashBoard
flat: true
text: qsTr("Dashboard") ButtonGroup.group: buttonBar
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3 Layout.margins: 3
Layout.topMargin: Dimensions.s Layout.topMargin: Dimensions.s
flat: true
icon.source: "qrc:/images/dash.svg" icon.source: "qrc:/images/dash.svg"
ButtonGroup.group: buttonBar implicitHeight: 90
// background: Rectangle implicitWidth: 90
// { text: qsTr("Dashboard")
// id: dashiBackie
// border.width: dashBoard.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: dashBoard.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: dashBoard.pressed ? "#100" : "#000" }
// }
// }
onClicked:
{
appLoader.source = "Dashboard.qml"
onClicked: {
// dashiBackie.border.width = 2 appLoader.source = "Dashboard.qml";
// kundiBackie.border.width = 1
// mitoBackie.border.width = 1
// invoBackie.border.width = 1
// objBackie.border.width = 1
} }
} }
BarButton {
BarButton
{
id: kunden id: kunden
flat: true
text: qsTr("Kunden") ButtonGroup.group: buttonBar
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3 Layout.margins: 3
flat: true
icon.source: "qrc:/images/customer.svg" icon.source: "qrc:/images/customer.svg"
ButtonGroup.group: buttonBar implicitHeight: 90
// background: Rectangle implicitWidth: 90
// { text: qsTr("Kunden")
// id: kundiBackie
// border.width: kunden.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: kunden.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: kunden.pressed ? "#100" : "#000" }
// }
// }
onClicked:
{
// TODO: here we should call the model
appLoader.source = "CustomerTable.qml"
// kundiBackie.border.width = 2
// dashiBackie.border.width = 1
// mitoBackie.border.width = 1
// invoBackie.border.width = 1
// objBackie.border.width = 1
}
}
BarButton onClicked: {
{ appLoader.source = "CustomerTable.qml";
}
}
BarButton {
id: objekt id: objekt
flat: true
text: qsTr("Objekt") ButtonGroup.group: buttonBar
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3 Layout.margins: 3
flat: true
icon.source: "qrc:/images/object.svg" icon.source: "qrc:/images/object.svg"
ButtonGroup.group: buttonBar implicitHeight: 90
// background: Rectangle implicitWidth: 90
// { text: qsTr("Objekt")
// id: objBackie
// border.width: objekt.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: objekt.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: objekt.pressed ? "#100" : "#000" }
// }
// }
onClicked:
{
appLoader.source = "ObjectTable.qml"
// objBackie.border.width = 2
// dashiBackie.border.width = 1
// kundiBackie.border.width = 1
// mitoBackie.border.width = 1
// invoBackie.border.width = 1
}
onClicked: {
appLoader.source = "ObjectTable.qml";
} }
}
BarButton BarButton {
{
id: mitarbeiter id: mitarbeiter
flat: true
text: qsTr("Mitarbeiter") ButtonGroup.group: buttonBar
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3 Layout.margins: 3
flat: true
icon.source: "qrc:/images/employee.svg" icon.source: "qrc:/images/employee.svg"
implicitHeight: 90
implicitWidth: 90
text: qsTr("Mitarbeiter")
ButtonGroup.group: buttonBar onClicked: {
// background: Rectangle appLoader.source = "EmployeeTable.qml";
// {
// id: mitoBackie
// border.width: mitarbeiter.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: mitarbeiter.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: mitarbeiter.pressed ? "#100" : "#000" }
// }
// }
onClicked:
{
appLoader.source = "EmployeeTable.qml"
// mitoBackie.border.width = 2
// dashiBackie.border.width = 1
// kundiBackie.border.width = 1
// invoBackie.border.width = 1
// objBackie.border.width = 1
} }
} }
BarButton {
BarButton
{
id: offers id: offers
flat: true
text: qsTr("Angebote") ButtonGroup.group: buttonBar
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3 Layout.margins: 3
flat: true
icon.source: "qrc:/images/offer.svg" icon.source: "qrc:/images/offer.svg"
ButtonGroup.group: buttonBar
// background: Rectangle
// {
// id: offersBackie
// border.width: offers.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: offers.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: offers.pressed ? "#100" : "#000" }
// }
// }
onClicked:
{
appLoader.source = "OfferTable.qml"
// mitoBackie.border.width = 2
// dashiBackie.border.width = 1
// kundiBackie.border.width = 1
// invoBackie.border.width = 1
// objBackie.border.width = 1
// offersBackie.border.width = 1
}
}
BarButton
{
id: abrechnung
flat: true
text: qsTr("Abrechnung")
implicitWidth: 90
implicitHeight: 90 implicitHeight: 90
Layout.margins: 3 implicitWidth: 90
icon.source: "qrc:/images/invoice.svg" text: qsTr("Angebote")
ButtonGroup.group: buttonBar
// background: Rectangle
// {
// id: invoBackie
// border.width: abrechnung.activeFocus ? 2 : 1
// border.color: "#888"
// radius: 4
// gradient: Gradient
// {
// GradientStop { position: 0 ; color: abrechnung.pressed ? "#000" : "#001" }
// GradientStop { position: 1 ; color: abrechnung.pressed ? "#100" : "#000" }
// }
// }
}
Item onClicked: {
{ appLoader.source = "OfferTable.qml";
}
}
BarButton {
id: abrechnung
ButtonGroup.group: buttonBar
Layout.margins: 3
flat: true
icon.source: "qrc:/images/invoice.svg"
implicitHeight: 90
implicitWidth: 90
text: qsTr("Abrechnung")
}
Item {
id: hspacer id: hspacer
Layout.fillHeight: true Layout.fillHeight: true
} }
BarButton {
BarButton
{
id: atajos id: atajos
implicitWidth: 90
implicitHeight: 90
checkable: false
icon.source: "qrc:/images/Bars3.svg"
flat: true
Layout.bottomMargin: Dimensions.s Layout.bottomMargin: Dimensions.s
checkable: false
flat: true
icon.source: "qrc:/images/Bars3.svg"
implicitHeight: 90
implicitWidth: 90
onClicked: mainMenu.open() onClicked: mainMenu.open()
Menu { Menu {
id: mainMenu id: mainMenu
MenuItem
{ MenuItem {
//text: qsTr("Benutzer-Verwaltung")
//onTriggered: appLoader.source = "UsersPage.qml"
text: qsTr("Einstellungen") text: qsTr("Einstellungen")
onTriggered:
{ onTriggered: {
// TODO: Check if logged-in user is admin first!! // TODO: Check if logged-in user is admin first!!
appLoader.source = "PyqcrmConf.qml" appLoader.source = "PyqcrmConf.qml";
} }
} }
MenuSeparator {} MenuSeparator {
MenuItem { text: qsTr("Als PDF exportieren") } }
MenuSeparator {} MenuItem {
MenuItem { text: qsTr("Drucken") } text: qsTr("Als PDF exportieren")
MenuItem }
{ MenuSeparator {
}
MenuItem {
text: qsTr("Drucken")
}
MenuItem {
text: qsTr("Erweiterter Druck") text: qsTr("Erweiterter Druck")
onTriggered: printerDialog.show() onTriggered: printerDialog.show()
} }
MenuSeparator {} MenuSeparator {
MenuItem }
{ MenuItem {
text: qsTr("Über PYQCRM") text: qsTr("Über PYQCRM")
onTriggered: readMeWin.show() onTriggered: readMeWin.show()
} }
} }
} }
} }

View File

@@ -6,82 +6,44 @@ import QtQuick.Templates as T
T.ToolButton { T.ToolButton {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
checkable: true checkable: true
icon.color: Colors.foreground icon.color: Colors.foreground
icon.height: 36 icon.height: 36
icon.width: 36 icon.width: 36
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding)
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
topPadding: 20 topPadding: 20
// horizontalPadding: padding + 2
// spacing: 6
// display: AbstractButton.TextUnderIcon
// icon.color: control.checked || control.highlighted ? control.palette.brightText :
// control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
contentItem: Column
{
IconLabel
{
x: parent.width * .5 - width * .5
// height: icon.height
// width: icon.width
icon: control.icon
// display: control.display
}
Label
{
text: control.text
font: Typography.dash
color: Colors.foreground
x: parent.width * .5 - width * .5
}
// spacing: control.spacing
// mirrored: control.mirrored
// display: control.TextUnderIcon
// icon: control.icon
// text: control.text
// font: control.font
// color: control.checked || control.highlighted ? control.palette.brightText :
// control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
}
background: Rectangle { background: Rectangle {
id: mainrect id: mainrect
implicitWidth: control.width
border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
implicitHeight: control.height implicitHeight: control.height
implicitWidth: control.width
visible: !control.flat || control.down || control.checked || control.highlighted visible: !control.flat || control.down || control.checked || control.highlighted
x: control.left x: control.left
y: control.top y: control.top
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
control.palette.mid, control.down ? 0.5 : 0.0) Rectangle {
border.color: control.palette.highlight color: "yellow"
border.width: control.visualFocus ? 2 : 0
Rectangle
{
implicitHeight: control.height implicitHeight: control.height
implicitWidth: 6 implicitWidth: 6
x: mainrect.left x: mainrect.left
y: mainrect.top y: mainrect.top
color: "yellow"
} }
} }
contentItem: Column {
IconLabel {
icon: control.icon
x: parent.width * .5 - width * .5
}
Label {
color: Colors.foreground
font: Typography.dash
text: control.text
x: parent.width * .5 - width * .5
}
}
} }