GUI ausbau
This commit is contained in:
@@ -72,11 +72,23 @@ Item {
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: dbm
|
||||
selectionBehavior: TableView.SelectRows
|
||||
selectionModel: ItemSelectionModel
|
||||
|
||||
delegate:Item
|
||||
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -87,8 +99,21 @@ Item {
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
property bool hovered:false
|
||||
|
||||
anchors.fill: parent
|
||||
onClicked: dbm.onRowClicked(row)
|
||||
hoverEnabled: true
|
||||
|
||||
|
||||
onClicked:
|
||||
{
|
||||
dbm.onRowClicked(row)
|
||||
testTable.selectionModel.select(testTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
126
gui/EmployeTables.qml
Normal file
126
gui/EmployeTables.qml
Normal file
@@ -0,0 +1,126 @@
|
||||
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
|
||||
}
|
||||
|
||||
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: dbm
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
property bool hovered:false
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
|
||||
onClicked:
|
||||
{
|
||||
dbm.onRowClicked(row)
|
||||
testTable.selectionModel.select(testTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ RowLayout
|
||||
flat: true
|
||||
text: qsTr("Objekt")
|
||||
implicitWidth: objekt.implicitContentWidth + 10
|
||||
|
||||
}
|
||||
|
||||
Button
|
||||
@@ -55,6 +56,10 @@ RowLayout
|
||||
flat: true
|
||||
text: qsTr("Mitarbeiter")
|
||||
implicitWidth: mitarbeiter.implicitContentWidth + 10
|
||||
onClicked:
|
||||
{
|
||||
appLoader.source = "EmployeTables.qml"
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
|
||||
1
main.py
1
main.py
@@ -50,6 +50,7 @@ if __name__ == "__main__":
|
||||
if not config.getConfig():
|
||||
bad_config = True
|
||||
|
||||
|
||||
engine.rootContext().setContextProperty("dbm", dbm)
|
||||
engine.rootContext().setContextProperty("bad_config", bad_config) # print(f"Fehler: {i}")
|
||||
engine.rootContext().setContextProperty("config", config)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"gui/CustomerTables.qml",
|
||||
"gui/SearchBar.qml",
|
||||
"gui/test.qml",
|
||||
"lib/DataBase.py"
|
||||
"lib/DataBase.py",
|
||||
"gui/EmployeTables.qml"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user