Fixing ObjectAddOnContactPerson.qml conflict

This commit is contained in:
2025-02-27 14:28:27 +01:00
12 changed files with 226 additions and 80 deletions

View File

@@ -95,7 +95,10 @@ ColumnLayout
Layout.fillHeight: true
}
Component.onCompleted:
{
object_model.objectAdded.connect(onObjectAdded)
}
// Connections
// {

17
Gui/CompanyConf.qml Normal file
View File

@@ -0,0 +1,17 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Item
{
property string name: "company"
anchors.fill: parent
Label
{
text: qsTr("Das Unternehmen")
anchors.centerIn: parent
font.pixelSize: 57
font.bold: true
}
}

View File

@@ -231,6 +231,25 @@ GridLayout
}
}
Component
{
id: highlight
Rectangle
{
width: 230; height: 15
color: "lightsteelblue"; radius: 5
y: contactView.currentItem.y
Behavior on y
{
SpringAnimation
{
spring: 3
damping: 0.2
}
}
}
}
Rectangle
{
id: mainRect
@@ -248,7 +267,6 @@ GridLayout
header: headline
highlight: Rectangle { color: "grey"}
highlightFollowsCurrentItem: false
onActiveFocusChanged: if(!focus) currentIndex = -1
delegate: Item
{
@@ -263,6 +281,17 @@ GridLayout
contactView.highlightFollowsCurrentItem = true
}
}
MouseArea
{
id: clickedRow
anchors.fill: parent
onClicked:
{
//var currentIndex = index
console.log(index)
console.log(contactView.currentItem.y)
}
}
Row
{
@@ -297,6 +326,8 @@ GridLayout
}
}
}
}
}
}

View File

@@ -15,13 +15,13 @@ Item
Button
{
text: qsTr("Objekts zeigen")
onClicked: customersStack.pop()
text: qsTr("Zurück zu den Objekten")
onClicked: objectsStack.pop()
}
}
Component.onCompleted:
{
business_model.onRowClicked(selectedObject)
object_model.onRowClicked(selectedObject)
}
}

View File

@@ -39,7 +39,7 @@ Item
id: horizontalHeaderview
Layout.fillWidth: true
implicitHeight: 40
visible: false
//visible: false
movableColumns: true //@disable-check M16
syncView: objectTable
@@ -68,36 +68,22 @@ Item
id: objectTable
Layout.fillHeight: true
Layout.fillWidth: true
columnSpacing: 1
rowSpacing: 2
model: object_model
alternatingRows: true
resizableColumns: true // @disable-check M16
selectionBehavior: TableView.SelectRows
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
@@ -112,7 +98,7 @@ Item
Text
{
text: model.display === null? "": model.display
text: (model.display === null || model.display === undefined)? "": model.display
elide: Text.ElideRight
width: parent.width
height: parent.height

95
Gui/PyqcrmConf.qml Normal file
View File

@@ -0,0 +1,95 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item
{
anchors.fill: parent
TabBar
{
id: bar
width: parent.width
TabButton
{
text: qsTr("Benutzer")
}
TabButton
{
text: qsTr("Datenbank")
}
TabButton
{
text: qsTr("Das Unternehmen")
}
}
StackLayout
{
id: confContainer
anchors.fill: parent
currentIndex: bar.currentIndex
Item
{
id: userTab
UsersPage
{
id: usersPage
anchors.fill: parent
}
}
Item
{
id: dbTab
DbConfiguration
{
id: dbConf
anchors.fill: parent
}
}
Item
{
id: companyTab
CompanyConf
{
id: companyConf
anchors.fill: parent
}
}
}
RowLayout
{
width: parent.width
anchors.bottom: parent.bottom
Item
{
Layout.fillWidth: true
}
Button
{
text: qsTr("Ablehnen")
onClicked: appLoader.source = "Dashboard.qml"
}
Button
{
text: qsTr("Speichern")
onClicked:
{
switch (confContainer.currentIndex)
{
case 1:
console.log("Need to update DB paramenters")
break
case 2:
console.log("Need to update company's info.")
break
default:
console.log("Need to handle users")
}
}
}
}
}

View File

@@ -178,8 +178,15 @@ RowLayout
id: mainMenu
MenuItem
{
text: qsTr("Benutzer-Verwaltung")
onTriggered: appLoader.source = "UsersPage.qml"
//text: qsTr("Benutzer-Verwaltung")
//onTriggered: appLoader.source = "UsersPage.qml"
text: qsTr("Einstellungen")
onTriggered:
{
// TODO: Check if logged-in user is admin first!!
appLoader.source = "PyqcrmConf.qml"
}
}
MenuSeparator {}
MenuItem { text: qsTr("Als PDF exportieren") }

View File

@@ -4,6 +4,7 @@ import QtQuick.Controls
Item
{
property string name: "users"
anchors.fill: parent
Label