customertable
This commit is contained in:
181
gui/CustomerTables.qml
Normal file
181
gui/CustomerTables.qml
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Qt.labs.qmlmodels
|
||||||
|
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SearchBar
|
||||||
|
{
|
||||||
|
id:searchBar
|
||||||
|
anchors.margins: 9
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout
|
||||||
|
{
|
||||||
|
// SearchBar
|
||||||
|
// {
|
||||||
|
// id:searchBar
|
||||||
|
// anchors.margins: 9
|
||||||
|
// }
|
||||||
|
anchors
|
||||||
|
{
|
||||||
|
|
||||||
|
top: searchBar.bottom
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
|
// Layout.fillHeight: true
|
||||||
|
// Layout.fillWidth: true
|
||||||
|
|
||||||
|
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
|
||||||
|
checked: true
|
||||||
|
text: qsTr("Alle")
|
||||||
|
}
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
|
||||||
|
text: qsTr("Interessent")
|
||||||
|
}
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
|
||||||
|
text: qsTr("Kunden")
|
||||||
|
}
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
|
||||||
|
text: qsTr("Erledigt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TableView {
|
||||||
|
id: testTable
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
columnSpacing: 10
|
||||||
|
rowSpacing: 2
|
||||||
|
|
||||||
|
|
||||||
|
model: TableModel {
|
||||||
|
TableModelColumn { display: "checked" }
|
||||||
|
TableModelColumn { display: "amount" }
|
||||||
|
TableModelColumn { display: "fruitType" }
|
||||||
|
TableModelColumn { display: "fruitName" }
|
||||||
|
TableModelColumn { display: "fruitPrice" }
|
||||||
|
|
||||||
|
|
||||||
|
rows: [
|
||||||
|
{
|
||||||
|
checked: "checked",
|
||||||
|
amount: "amount",
|
||||||
|
fruitType: "Fruittype",
|
||||||
|
fruitName: "fruitName",
|
||||||
|
fruitPrice: "Price"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: true,
|
||||||
|
amount: 2,
|
||||||
|
fruitType: "Fruittype",
|
||||||
|
fruitName: "blabla",
|
||||||
|
fruitPrice: 1.50
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
checked: true,
|
||||||
|
amount: 1,
|
||||||
|
fruitType: "Apple",
|
||||||
|
fruitName: "Granny Smith",
|
||||||
|
fruitPrice: 1.50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: "true",
|
||||||
|
amount: 4,
|
||||||
|
fruitType: "Orange",
|
||||||
|
fruitName: "Navel",
|
||||||
|
fruitPrice: 2.50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: "false",
|
||||||
|
amount: 1,
|
||||||
|
fruitType: "Banana",
|
||||||
|
fruitName: "Cavendish",
|
||||||
|
fruitPrice: 3.50
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: DelegateChooser {
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
column: 0
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "checked"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 1
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "amount"
|
||||||
|
//onLinkHovered: model.display = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 2
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//model.display : "fruitType"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 3
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "fruitName"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 4
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "fruitPrice"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} }
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -4,10 +4,11 @@ import QtQuick.Controls
|
|||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
id: searchBar
|
||||||
|
height: 30
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
id: searchBar
|
id: searchField
|
||||||
placeholderText: qsTr("Suche")
|
placeholderText: qsTr("Suche")
|
||||||
leftPadding: 3
|
leftPadding: 3
|
||||||
rightPadding: 3
|
rightPadding: 3
|
||||||
@@ -32,8 +33,8 @@ Item
|
|||||||
{
|
{
|
||||||
icon.source: "../images/filter.svg"
|
icon.source: "../images/filter.svg"
|
||||||
icon.color: "olive"
|
icon.color: "olive"
|
||||||
anchors.left: searchBar.right
|
anchors.left: searchField.right
|
||||||
height: searchBar.height
|
height: searchField.height
|
||||||
flat: true
|
flat: true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
|
|
||||||
SearchBar
|
|
||||||
{
|
|
||||||
id:searchBar
|
|
||||||
anchors.margins: 9
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,7 @@ import QtQuick.Layouts
|
|||||||
implicitWidth: kunden.implicitContentWidth + 10
|
implicitWidth: kunden.implicitContentWidth + 10
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
appLoader.source = "Tables.qml"
|
appLoader.source = "CustomerTables.qml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ApplicationWindow
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
source: bad_config? "firststart.qml": "Dashboard.qml"
|
source: bad_config? "firststart.qml": "test.qml"
|
||||||
property alias window: appWindow
|
property alias window: appWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
119
gui/test.qml
Normal file
119
gui/test.qml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Qt.labs.qmlmodels
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TableView {
|
||||||
|
id: testTable
|
||||||
|
anchors.fill: parent
|
||||||
|
columnSpacing: 10
|
||||||
|
rowSpacing: 2
|
||||||
|
//boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
|
model: TableModel {
|
||||||
|
TableModelColumn { display: "checked" }
|
||||||
|
TableModelColumn { display: "amount" }
|
||||||
|
TableModelColumn { display: "fruitType" }
|
||||||
|
TableModelColumn { display: "fruitName" }
|
||||||
|
TableModelColumn { display: "fruitPrice" }
|
||||||
|
|
||||||
|
|
||||||
|
rows: [
|
||||||
|
{
|
||||||
|
checked: "checked",
|
||||||
|
amount: "amount",
|
||||||
|
fruitType: "Fruittype",
|
||||||
|
fruitName: "fruitName",
|
||||||
|
fruitPrice: "Price"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: true,
|
||||||
|
amount: 2,
|
||||||
|
fruitType: "Fruittype",
|
||||||
|
fruitName: "blabla",
|
||||||
|
fruitPrice: 1.50
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
checked: true,
|
||||||
|
amount: 1,
|
||||||
|
fruitType: "Apple",
|
||||||
|
fruitName: "Granny Smith",
|
||||||
|
fruitPrice: 1.50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: "true",
|
||||||
|
amount: 4,
|
||||||
|
fruitType: "Orange",
|
||||||
|
fruitName: "Navel",
|
||||||
|
fruitPrice: 2.50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
checked: "false",
|
||||||
|
amount: 1,
|
||||||
|
fruitType: "Banana",
|
||||||
|
fruitName: "Cavendish",
|
||||||
|
fruitPrice: 3.50
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: DelegateChooser {
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
column: 0
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "checked"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 1
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "amount"
|
||||||
|
//onLinkHovered: model.display = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 2
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//model.display : "fruitType"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 3
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "fruitName"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
column: 4
|
||||||
|
delegate: Text {
|
||||||
|
|
||||||
|
text: model.display
|
||||||
|
//selectByMouse: true
|
||||||
|
//implicitWidth: 140
|
||||||
|
//onVisibleChanged: model.display = "fruitPrice"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
"js/qmldict.js",
|
"js/qmldict.js",
|
||||||
"lib/Vermasseln.py",
|
"lib/Vermasseln.py",
|
||||||
"gui/TopBar.qml",
|
"gui/TopBar.qml",
|
||||||
"gui/Tables.qml",
|
"gui/CustomerTables.qml",
|
||||||
"gui/SearchBar.qml"
|
"gui/SearchBar.qml",
|
||||||
|
"gui/test.qml"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user