positioning searchbar and quickfilter
This commit is contained in:
@@ -3,114 +3,170 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import Qt.labs.qmlmodels
|
import Qt.labs.qmlmodels
|
||||||
|
|
||||||
Item
|
ColumnLayout
|
||||||
{
|
{
|
||||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
|
||||||
|
|
||||||
|
function viewEmployees(criterion)
|
||||||
|
{
|
||||||
|
employee_model.viewCriterion(criterion)
|
||||||
|
// employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Component.onCompleted: employeesStack.pop()
|
||||||
|
// property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
SearchBar
|
SearchBar
|
||||||
{
|
{
|
||||||
id:searchBar
|
id:searchBar
|
||||||
anchors.margins: 9
|
}
|
||||||
|
QuickFilter
|
||||||
|
{
|
||||||
|
onSelectedChanged: (name) =>
|
||||||
|
{
|
||||||
|
business_model.viewCriterion(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model: ListModel
|
||||||
|
{
|
||||||
|
ListElement
|
||||||
|
{
|
||||||
|
|
||||||
|
name: "Alle"
|
||||||
|
text: qsTr("Alle")
|
||||||
|
selected: true
|
||||||
|
}
|
||||||
|
ListElement
|
||||||
|
{
|
||||||
|
name: "Bewerber"
|
||||||
|
text: qsTr("Bewerber")
|
||||||
|
selected: false
|
||||||
|
}
|
||||||
|
ListElement
|
||||||
|
{
|
||||||
|
name: "Mitarbeiter"
|
||||||
|
text: qsTr("Kunde")
|
||||||
|
selected: false
|
||||||
|
}
|
||||||
|
ListElement
|
||||||
|
{
|
||||||
|
name: "Lieferant"
|
||||||
|
text: qsTr("Lieferant")
|
||||||
|
selected: false
|
||||||
|
}
|
||||||
|
ListElement
|
||||||
|
{
|
||||||
|
name: "Erledigt"
|
||||||
|
text: qsTr("Erledigt")
|
||||||
|
selected: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: addEmployeeBtn
|
id: addEmployeeBtn
|
||||||
text: qsTr("Mitarbeiter Hinzufügen")
|
text: qsTr("Mitarbeiter Hinzufügen")
|
||||||
icon.source: "qrc:/images/PlusCircle.svg"
|
icon.source: "qrc:/images/PlusCircle.svg"
|
||||||
anchors.right: parent.right
|
Layout.alignment: Qt.AlignRight
|
||||||
flat: true
|
flat: true
|
||||||
onClicked: appLoader.source = "AddApplicant.qml"
|
onClicked: appLoader.source = "AddApplicant.qml"
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonGroup
|
|
||||||
{
|
|
||||||
id: criterion
|
|
||||||
// buttons: criterion.children
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
viewEmployees(criterion.checkedButton.text)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout
|
|
||||||
{
|
|
||||||
id: tableParent
|
|
||||||
clip: true
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
|
|
||||||
top: searchBar.bottom
|
|
||||||
bottom: parent.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout
|
|
||||||
{
|
|
||||||
id: viewCriterion
|
|
||||||
|
|
||||||
RadioButton
|
|
||||||
{
|
|
||||||
//id: showAll
|
|
||||||
checked: true
|
|
||||||
text: qsTr("Alle")
|
|
||||||
ButtonGroup.group: criterion
|
|
||||||
//onClicked: viewEmployees(showAll)
|
|
||||||
}
|
|
||||||
RadioButton
|
|
||||||
{
|
|
||||||
//id: showApplicant
|
|
||||||
text: qsTr("Bewerber")
|
|
||||||
ButtonGroup.group: criterion
|
|
||||||
//onClicked: viewEmployees(showApplicant)
|
|
||||||
}
|
|
||||||
RadioButton
|
|
||||||
{
|
|
||||||
//id: showEmployee
|
|
||||||
text: qsTr("Mitarbeiter")
|
|
||||||
ButtonGroup.group: criterion
|
|
||||||
//onClicked: viewEmployees(showEmployee)
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckBox
|
// ButtonGroup
|
||||||
{
|
// {
|
||||||
id: showEveryone
|
// id: criterion
|
||||||
text: qsTr("Alle Stati")
|
// // buttons: criterion.children
|
||||||
checked: true
|
// onClicked:
|
||||||
onClicked: viewEmployees(criterion.checkedButton.text)
|
// {
|
||||||
onCheckedChanged:
|
// viewEmployees(criterion.checkedButton.text)
|
||||||
{
|
// }
|
||||||
showFired.checked = false
|
// }
|
||||||
showProcessed.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CheckBox
|
|
||||||
{
|
|
||||||
id: showProcessed
|
|
||||||
text: qsTr("Erledigt")
|
|
||||||
enabled: !showEveryone.checked
|
|
||||||
checked: false
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
showFired.checked = false
|
|
||||||
viewEmployees(criterion.checkedButton.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CheckBox
|
|
||||||
{
|
|
||||||
id: showFired
|
|
||||||
text: qsTr("Ausgeschieden")
|
|
||||||
enabled: !showEveryone.checked
|
|
||||||
checked: false
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
showProcessed.checked = false
|
|
||||||
viewEmployees(criterion.checkedButton.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
// ColumnLayout
|
||||||
|
// {
|
||||||
|
// id: tableParent
|
||||||
|
// clip: true
|
||||||
|
// anchors
|
||||||
|
// {
|
||||||
|
|
||||||
|
// top: searchBar.bottom
|
||||||
|
// bottom: parent.bottom
|
||||||
|
// left: parent.left
|
||||||
|
// right: parent.right
|
||||||
|
// }
|
||||||
|
|
||||||
|
// RowLayout
|
||||||
|
// {
|
||||||
|
// id: viewCriterion
|
||||||
|
|
||||||
|
// RadioButton
|
||||||
|
// {
|
||||||
|
// //id: showAll
|
||||||
|
// checked: true
|
||||||
|
// text: qsTr("Alle")
|
||||||
|
// ButtonGroup.group: criterion
|
||||||
|
// //onClicked: viewEmployees(showAll)
|
||||||
|
// }
|
||||||
|
// RadioButton
|
||||||
|
// {
|
||||||
|
// //id: showApplicant
|
||||||
|
// text: qsTr("Bewerber")
|
||||||
|
// ButtonGroup.group: criterion
|
||||||
|
// //onClicked: viewEmployees(showApplicant)
|
||||||
|
// }
|
||||||
|
// RadioButton
|
||||||
|
// {
|
||||||
|
// //id: showEmployee
|
||||||
|
// text: qsTr("Mitarbeiter")
|
||||||
|
// ButtonGroup.group: criterion
|
||||||
|
// //onClicked: viewEmployees(showEmployee)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// CheckBox
|
||||||
|
// {
|
||||||
|
// id: showEveryone
|
||||||
|
// text: qsTr("Alle Stati")
|
||||||
|
// checked: true
|
||||||
|
// onClicked: viewEmployees(criterion.checkedButton.text)
|
||||||
|
// onCheckedChanged:
|
||||||
|
// {
|
||||||
|
// showFired.checked = false
|
||||||
|
// showProcessed.checked = false
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// CheckBox
|
||||||
|
// {
|
||||||
|
// id: showProcessed
|
||||||
|
// text: qsTr("Erledigt")
|
||||||
|
// enabled: !showEveryone.checked
|
||||||
|
// checked: false
|
||||||
|
// onClicked:
|
||||||
|
// {
|
||||||
|
// showFired.checked = false
|
||||||
|
// viewEmployees(criterion.checkedButton.text)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// CheckBox
|
||||||
|
// {
|
||||||
|
// id: showFired
|
||||||
|
// text: qsTr("Ausgeschieden")
|
||||||
|
// enabled: !showEveryone.checked
|
||||||
|
// checked: false
|
||||||
|
// onClicked:
|
||||||
|
// {
|
||||||
|
// showProcessed.checked = false
|
||||||
|
// viewEmployees(criterion.checkedButton.text)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
HorizontalHeaderView
|
HorizontalHeaderView
|
||||||
{
|
{
|
||||||
@@ -143,8 +199,9 @@ Item
|
|||||||
{
|
{
|
||||||
id: appliEmpTable
|
id: appliEmpTable
|
||||||
//Layout.fillHeight: true
|
//Layout.fillHeight: true
|
||||||
height: tableParent.height - (viewCriterion.height + employeeTableHeader.height)
|
//height: tableParent.height - (viewCriterion.height + employeeTableHeader.height)
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
columnSpacing: 1
|
columnSpacing: 1
|
||||||
rowSpacing: 2
|
rowSpacing: 2
|
||||||
alternatingRows: true
|
alternatingRows: true
|
||||||
@@ -216,9 +273,9 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function viewEmployees(criterion)
|
// function viewEmployees(criterion)
|
||||||
{
|
// {
|
||||||
employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked)
|
// employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked)
|
||||||
}
|
// }
|
||||||
Component.onCompleted: employeesStack.pop()
|
// Component.onCompleted: employeesStack.pop()
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,37 +5,86 @@ import Qt.labs.qmlmodels
|
|||||||
|
|
||||||
ColumnLayout
|
ColumnLayout
|
||||||
{
|
{
|
||||||
|
function viewCriterion(criterion)
|
||||||
|
{
|
||||||
|
business_model.viewCriterion(criterion.text);
|
||||||
|
}
|
||||||
|
function onObjectContactAdded(added)
|
||||||
|
{
|
||||||
|
console.log(added)
|
||||||
|
if (added) object_model.viewCriterion("")
|
||||||
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
contact_model.objectContactAdded.connect(onObjectContactAdded)
|
||||||
|
objectsStack.pop()
|
||||||
|
}
|
||||||
RowLayout
|
RowLayout
|
||||||
{
|
{
|
||||||
SearchBar
|
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
|
Button
|
||||||
{
|
{
|
||||||
id: addObjectBtn
|
id: addObjectBtn
|
||||||
icon.source: "qrc:/images/PlusCircle.svg"
|
icon.source: "qrc:/images/PlusCircle.svg"
|
||||||
text: qsTr("Objekt Hinzufügen")
|
text: qsTr("Objekt Hinzufügen")
|
||||||
anchors.right: parent.right
|
Layout.alignment: Qt.AlignRight
|
||||||
onClicked: appLoader.source = "AddObject.qml"
|
onClicked: appLoader.source = "AddObject.qml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ColumnLayout
|
ColumnLayout
|
||||||
{
|
{
|
||||||
id: tableColumn
|
id: tableColumn
|
||||||
clip: true
|
clip: true
|
||||||
anchors
|
// anchors
|
||||||
{
|
// {
|
||||||
top: searchBar.bottom
|
// top: searchBar.bottom
|
||||||
bottom: parent.bottom
|
// bottom: parent.bottom
|
||||||
left: parent.left
|
// left: parent.left
|
||||||
right: parent.right
|
// right: parent.right
|
||||||
topMargin: 15
|
// topMargin: 15
|
||||||
}
|
// }
|
||||||
HorizontalHeaderView
|
HorizontalHeaderView
|
||||||
{
|
{
|
||||||
id: horizontalHeaderview
|
id: horizontalHeaderview
|
||||||
@@ -134,26 +183,32 @@ ColumnLayout
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillHeight: true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// function onObjectContactAdded(added)
|
||||||
|
// {
|
||||||
|
// console.log(added)
|
||||||
|
// if (added) object_model.viewCriterion("")
|
||||||
|
// }
|
||||||
// function viewCriterion(criterion)
|
// function viewCriterion(criterion)
|
||||||
// {
|
// {
|
||||||
// object_model.viewCriterion(criterion.text)
|
// object_model.viewCriterion(criterion.text)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Component.onCompleted:
|
// Component.onCompleted:
|
||||||
{
|
// {
|
||||||
contact_model.objectContactAdded.connect(onObjectContactAdded)
|
// contact_model.objectContactAdded.connect(onObjectContactAdded)
|
||||||
objectsStack.pop()
|
// objectsStack.pop()
|
||||||
}
|
// }
|
||||||
|
|
||||||
function onObjectContactAdded(added)
|
// function onObjectContactAdded(added)
|
||||||
{
|
// {
|
||||||
console.log(added)
|
// console.log(added)
|
||||||
if (added) object_model.viewCriterion("")
|
// if (added) object_model.viewCriterion("")
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,72 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import Qt.labs.qmlmodels
|
import Qt.labs.qmlmodels
|
||||||
|
|
||||||
Item
|
ColumnLayout
|
||||||
{
|
{
|
||||||
property var availableFilters: []
|
anchors.fill: parent
|
||||||
|
function viewOffers(criterion)
|
||||||
|
{
|
||||||
|
//offer_model.viewCriterion(criterion)
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
SearchBar
|
SearchBar
|
||||||
{
|
{
|
||||||
id: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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ Label Label.qml
|
|||||||
QuickFilter QuickFilter.qml
|
QuickFilter QuickFilter.qml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user