Some GUI modification and DB documentation template
This commit is contained in:
27
Gui/CustomerDetails.qml
Normal file
27
Gui/CustomerDetails.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item
|
||||
{
|
||||
property int selectedClient: -1
|
||||
id: clDet
|
||||
ColumnLayout
|
||||
{
|
||||
Label
|
||||
{
|
||||
text: qsTr("Ausgewählter Kunde " + selectedClient)
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: qsTr("Kunden zeigen")
|
||||
onClicked: customersStack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
business_model.onRowClicked(selectedClient)
|
||||
}
|
||||
}
|
||||
@@ -9,206 +9,11 @@ Item {
|
||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort"]
|
||||
id: test
|
||||
|
||||
SearchBar
|
||||
StackView
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: addBusinessBtn
|
||||
icon.source: "qrc:/images/addbusiness.svg"
|
||||
icon.color: "olive"
|
||||
anchors.right: parent.right
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddCustomer.qml"
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: tableColumn
|
||||
anchors
|
||||
{
|
||||
top: searchBar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
RadioButton
|
||||
{
|
||||
id: showAll
|
||||
checked: true
|
||||
text: qsTr("Alle")
|
||||
onClicked: viewCriterion(showAll)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showInterested
|
||||
text: qsTr("Interessent")
|
||||
onClicked: viewCriterion(showInterested)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showClientele
|
||||
text: qsTr("Kunden")
|
||||
onClicked: viewCriterion(showClientele)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showProvider
|
||||
text: qsTr("Lieferant")
|
||||
onClicked: viewCriterion(showProvider)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showFinished
|
||||
text: qsTr("Erledigt")
|
||||
onClicked: viewCriterion(showFinished)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeader
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 40
|
||||
movableColumns: true //@disable-check M16
|
||||
syncView: customerTable
|
||||
|
||||
delegate: Rectangle {
|
||||
color: addBusinessBtn.palette.alternateBase
|
||||
border.color: addBusinessBtn.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: addBusinessBtn.palette.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
//property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2]
|
||||
property real newWidth: 0
|
||||
id: customerTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
policy: customerTable.contentHeight > customerTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
}
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: business_model
|
||||
alternatingRows: true
|
||||
resizableColumns: true // @disable-check M16
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
{
|
||||
id: selModel
|
||||
model: customerTable.model
|
||||
}
|
||||
|
||||
// columnWidthProvider: function(column)
|
||||
// {
|
||||
// switch (column)
|
||||
// {
|
||||
// case 0: return width * 0.2;
|
||||
// case 1: return width * 0.5;
|
||||
// case 2: return width * 0.3;
|
||||
// default: return width / model.columnCount();
|
||||
// }
|
||||
//return customWidths[column] * width;
|
||||
//return tableColumn.content.implicitWidth // model.columnCount()
|
||||
// newWidth = columnWidth(column)
|
||||
// return newWidth
|
||||
// }
|
||||
|
||||
Timer
|
||||
{
|
||||
id: redrawTable
|
||||
running: true
|
||||
interval: 1
|
||||
repeat: false
|
||||
onTriggered:
|
||||
{
|
||||
customerTable.forceLayout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: customerTable.width / customerTable.columns
|
||||
implicitHeight: 25
|
||||
color: selected
|
||||
? addBusinessBtn.palette.highlight //palette.highlight
|
||||
: (customerTable.alternatingRows && row % 2 !== 0
|
||||
? addBusinessBtn.palette.base // palette.base
|
||||
: addBusinessBtn.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: addBusinessBtn.palette.text
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
property bool hovered: false
|
||||
id: mouseArea
|
||||
id: customersStack
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
business_model.onRowClicked(row)
|
||||
}
|
||||
onEntered:
|
||||
{
|
||||
customerTable.selectionModel.select(customerTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onContentWidthChanged:
|
||||
{
|
||||
//console.log("Model changed!!")
|
||||
redrawTable.start()
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
//Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
function viewCriterion(criterion)
|
||||
{
|
||||
business_model.viewCriterion(criterion.text)
|
||||
initialItem: "CustomersTable.qml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
219
Gui/CustomersTable.qml
Normal file
219
Gui/CustomersTable.qml
Normal file
@@ -0,0 +1,219 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
import QtQuick.Controls.Fusion
|
||||
|
||||
Item
|
||||
{
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: addBusinessBtn
|
||||
icon.source: "qrc:/images/addbusiness.svg"
|
||||
icon.color: "olive"
|
||||
anchors.right: parent.right
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddCustomer.qml"
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: tableColumn
|
||||
anchors
|
||||
{
|
||||
top: searchBar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
RadioButton
|
||||
{
|
||||
id: showAll
|
||||
checked: true
|
||||
text: qsTr("Alle")
|
||||
onClicked: viewCriterion(showAll)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showInterested
|
||||
text: qsTr("Interessent")
|
||||
onClicked: viewCriterion(showInterested)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showClientele
|
||||
text: qsTr("Kunden")
|
||||
onClicked: viewCriterion(showClientele)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showProvider
|
||||
text: qsTr("Lieferant")
|
||||
onClicked: viewCriterion(showProvider)
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
id: showFinished
|
||||
text: qsTr("Erledigt")
|
||||
onClicked: viewCriterion(showFinished)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeader
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 40
|
||||
movableColumns: true //@disable-check M16
|
||||
syncView: customerTable
|
||||
|
||||
delegate: Rectangle {
|
||||
color: addBusinessBtn.palette.alternateBase
|
||||
border.color: addBusinessBtn.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: addBusinessBtn.palette.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
//property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2]
|
||||
property real newWidth: 0
|
||||
id: customerTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
policy: customerTable.contentHeight > customerTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
}
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: business_model
|
||||
alternatingRows: true
|
||||
resizableColumns: true // @disable-check M16
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
{
|
||||
id: selModel
|
||||
model: customerTable.model
|
||||
}
|
||||
|
||||
// columnWidthProvider: function(column)
|
||||
// {
|
||||
// switch (column)
|
||||
// {
|
||||
// case 0: return width * 0.2;
|
||||
// case 1: return width * 0.5;
|
||||
// case 2: return width * 0.3;
|
||||
// default: return width / model.columnCount();
|
||||
// }
|
||||
//return customWidths[column] * width;
|
||||
//return tableColumn.content.implicitWidth // model.columnCount()
|
||||
// newWidth = columnWidth(column)
|
||||
// return newWidth
|
||||
// }
|
||||
|
||||
Timer
|
||||
{
|
||||
id: redrawTable
|
||||
running: true
|
||||
interval: 1
|
||||
repeat: false
|
||||
onTriggered:
|
||||
{
|
||||
customerTable.forceLayout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: customerTable.width / customerTable.columns
|
||||
implicitHeight: 25
|
||||
color: selected
|
||||
? addBusinessBtn.palette.highlight //palette.highlight
|
||||
: (customerTable.alternatingRows && row % 2 !== 0
|
||||
? addBusinessBtn.palette.base // palette.base
|
||||
: addBusinessBtn.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: addBusinessBtn.palette.text
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
property bool hovered: false
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
// onClicked:
|
||||
// {
|
||||
// business_model.onRowClicked(row)
|
||||
// }
|
||||
|
||||
onDoubleClicked:
|
||||
{
|
||||
customersStack.push("CustomerDetails.qml", {selectedClient: row});
|
||||
}
|
||||
|
||||
onEntered:
|
||||
{
|
||||
customerTable.selectionModel.select(customerTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onContentWidthChanged:
|
||||
{
|
||||
//console.log("Model changed!!")
|
||||
redrawTable.start()
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
//Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
function viewCriterion(criterion)
|
||||
{
|
||||
business_model.viewCriterion(criterion.text)
|
||||
}
|
||||
|
||||
Component.onCompleted: customersStack.pop()
|
||||
}
|
||||
@@ -8,9 +8,124 @@ ColumnLayout
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: "blue"
|
||||
color: "dimgrey"
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 9
|
||||
Layout.bottomMargin: 3
|
||||
radius: 45
|
||||
|
||||
RowLayout
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: contractButton
|
||||
width: 300
|
||||
height: 145
|
||||
color: "darkslategray"
|
||||
radius: 45
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
border.color: "steelblue"
|
||||
border.width: 1
|
||||
Text
|
||||
{
|
||||
text: qsTr("Aufträge")
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 45
|
||||
font.bold: true
|
||||
color: "lightgoldenrodyellow"
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
onPressed:
|
||||
{
|
||||
contractButton.color = "darkolivegreen"
|
||||
contractButton.border.width = 3
|
||||
contractButton.border.color = "skyblue"
|
||||
console.log("Aufträge...")
|
||||
}
|
||||
|
||||
onReleased:
|
||||
{
|
||||
contractButton.color = "darkslategray"
|
||||
contractButton.border.width = 1
|
||||
contractButton.border.color = "steelblue"
|
||||
}
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
var w = contractButton.border.width === 3? 1: 3
|
||||
contractButton.border.width = w
|
||||
}
|
||||
|
||||
onExited:
|
||||
{
|
||||
|
||||
contractButton.color = "darkslategray"
|
||||
contractButton.border.color = "steelblue"
|
||||
contractButton.border.width = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: offerButton
|
||||
width: 300
|
||||
height: 145
|
||||
color: "darkslategray"
|
||||
radius: 45
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
border.color: "steelblue"
|
||||
border.width: 1
|
||||
Text
|
||||
{
|
||||
text: qsTr("Angebote")
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 45
|
||||
font.bold: true
|
||||
color: "lightgoldenrodyellow"
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
|
||||
onPressed:
|
||||
{
|
||||
offerButton.color = "darkolivegreen"
|
||||
offerButton.border.width = 3
|
||||
offerButton.border.color = "skyblue"
|
||||
console.log("Angebote...")
|
||||
}
|
||||
onReleased:
|
||||
{
|
||||
offerButton.color = "darkslategray"
|
||||
offerButton.border.width = 1
|
||||
offerButton.border.color = "steelblue"
|
||||
}
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
var w = offerButton.border.width === 3? 1: 3
|
||||
offerButton.border.width = w
|
||||
}
|
||||
|
||||
onExited:
|
||||
{
|
||||
|
||||
offerButton.color = "darkslategray"
|
||||
offerButton.border.color = "steelblue"
|
||||
offerButton.border.width = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
Gui/EmployeeDetails.qml
Normal file
27
Gui/EmployeeDetails.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item
|
||||
{
|
||||
property int selectedEmployee: -1
|
||||
id: emDet
|
||||
ColumnLayout
|
||||
{
|
||||
Label
|
||||
{
|
||||
text: qsTr("Ausgewählter Mitarbeiter " + selectedEmployee)
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: qsTr("Mitarbeiter zeigen")
|
||||
onClicked: employeesStack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
business_model.onRowClicked(selectedEmployee)
|
||||
}
|
||||
}
|
||||
@@ -4,131 +4,13 @@ import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
|
||||
Item {
|
||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
||||
|
||||
SearchBar
|
||||
Item
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
StackView
|
||||
{
|
||||
id: addEmployeeBtn
|
||||
icon.source: "qrc:/images/addbusiness.svg"
|
||||
icon.color: "olive"
|
||||
anchors.right: parent.right
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddApplicant.qml"
|
||||
}
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
anchors
|
||||
{
|
||||
|
||||
top: searchBar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
|
||||
RadioButton
|
||||
{
|
||||
|
||||
checked: true
|
||||
text: qsTr("Alle")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Bewerber")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Mitarbeiter")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Erledigt")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Ausgeschieden")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeader
|
||||
Layout.fillWidth: true
|
||||
syncView: testTable
|
||||
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
id: testTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: business_model
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
|
||||
|
||||
{
|
||||
id: selModel
|
||||
model: testTable.model
|
||||
}
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: 200
|
||||
implicitHeight: 25
|
||||
color: selected? "lightblue": palette.base
|
||||
|
||||
Text
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
text: model.display? model.display: ""
|
||||
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
property bool hovered:false
|
||||
|
||||
id: employeesStack
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
|
||||
onClicked:
|
||||
{
|
||||
business_model.onRowClicked(row)
|
||||
testTable.selectionModel.select(testTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initialItem: "EmployeesTable.qml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
132
Gui/EmployeesTable.qml
Normal file
132
Gui/EmployeesTable.qml
Normal file
@@ -0,0 +1,132 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
Item
|
||||
{
|
||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
||||
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: addEmployeeBtn
|
||||
icon.source: "qrc:/images/addbusiness.svg"
|
||||
icon.color: "olive"
|
||||
anchors.right: parent.right
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddApplicant.qml"
|
||||
}
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
anchors
|
||||
{
|
||||
|
||||
top: searchBar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
|
||||
RadioButton
|
||||
{
|
||||
|
||||
checked: true
|
||||
text: qsTr("Alle")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Bewerber")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Mitarbeiter")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Erledigt")
|
||||
}
|
||||
RadioButton
|
||||
{
|
||||
|
||||
text: qsTr("Ausgeschieden")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeader
|
||||
Layout.fillWidth: true
|
||||
syncView: testTable
|
||||
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
id: testTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: business_model
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
|
||||
|
||||
{
|
||||
id: selModel
|
||||
model: testTable.model
|
||||
}
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: 200
|
||||
implicitHeight: 25
|
||||
color: selected? "lightblue": palette.base
|
||||
|
||||
Text
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
text: model.display? model.display: ""
|
||||
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
property bool hovered:false
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
|
||||
onDoubleClicked:
|
||||
{
|
||||
employeesStack.push("EmployeeDetails.qml", {selectedEmployee: row});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: employeesStack.pop()
|
||||
}
|
||||
27
Gui/ObjectDetails.qml
Normal file
27
Gui/ObjectDetails.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item
|
||||
{
|
||||
property int selectedObject: -1
|
||||
id: obDet
|
||||
ColumnLayout
|
||||
{
|
||||
Label
|
||||
{
|
||||
text: qsTr("Ausgewählter Objekt " + selectedObject)
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: qsTr("Objekts zeigen")
|
||||
onClicked: customersStack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
business_model.onRowClicked(selectedObject)
|
||||
}
|
||||
}
|
||||
@@ -6,156 +6,14 @@ import QtQuick.Controls.Fusion
|
||||
|
||||
Item {
|
||||
property var availableFilters: [""]
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
anchors.margins: 9
|
||||
}
|
||||
|
||||
Button
|
||||
StackView
|
||||
{
|
||||
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
|
||||
id: objectsStack
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
object_model.onRowClicked(row)
|
||||
}
|
||||
onEntered:
|
||||
{
|
||||
objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
initialItem: "ObjectsTable.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// onContentWidthChanged:
|
||||
// {
|
||||
|
||||
// redrawTable.start()
|
||||
// }
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
// function viewCriterion(criterion)
|
||||
// {
|
||||
// object_model.viewCriterion(criterion.text)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
160
Gui/ObjectsTable.qml
Normal file
160
Gui/ObjectsTable.qml
Normal file
@@ -0,0 +1,160 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
import QtQuick.Controls.Fusion
|
||||
|
||||
Item
|
||||
{
|
||||
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
|
||||
onDoubleClicked:
|
||||
{
|
||||
objectsStack.push("ObjectDetails.qml", {selectedObject: 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)
|
||||
// }
|
||||
|
||||
Component.onCompleted: objectsStack.pop()
|
||||
}
|
||||
@@ -41,7 +41,7 @@ ApplicationWindow
|
||||
top: topBar.bottom
|
||||
bottom: parent.bottom
|
||||
topMargin: 0
|
||||
bottomMargin: 9
|
||||
bottomMargin: 5
|
||||
rightMargin: 9
|
||||
leftMargin: 9
|
||||
}
|
||||
|
||||
BIN
doc/PYQCRM_DATENBANK.odt
Normal file
BIN
doc/PYQCRM_DATENBANK.odt
Normal file
Binary file not shown.
6
qml.qrc
6
qml.qrc
@@ -33,5 +33,11 @@
|
||||
<file>Gui/ApplicantMiniJob.qml</file>
|
||||
<file>Gui/ApplicantVarious.qml</file>
|
||||
<file>Gui/ApplicantBirthData.qml</file>
|
||||
<file>Gui/CustomersTable.qml</file>
|
||||
<file>Gui/CustomerDetails.qml</file>
|
||||
<file>Gui/ObjectsTable.qml</file>
|
||||
<file>Gui/EmployeesTable.qml</file>
|
||||
<file>Gui/EmployeeDetails.qml</file>
|
||||
<file>Gui/ObjectDetails.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
Reference in New Issue
Block a user