Files
advotracker/advotracker_qml/resources/pages/UserModelPage.qml
2020-06-19 17:44:02 +02:00

135 lines
3.9 KiB
QML
Executable File

/*
* AdvoTracker - Hotline tackingtool for Advocats
*
* Copyright (c) 2017 Ralf Zerres <ralf.zerres@networkx.de>
*
* AdvoTracker is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* AdvoTracker is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with AdvoTracker; If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.10 // Qt 5.10
import QtQuick.Controls 2.3 // Qt 5.10
import QtQuick.Layouts 1.3 // Qt 5.10
// our adapted Module
import de.networkx.AdvoTracker 1.0 as Nwx
import de.networkx.Users 1.0
import de.networkx.TableModel 1.0
/*
Item {
id: delegate
width: delegate.ListView.view.width;
height: 30
clip: true
anchors.margins: 4
Row {
anchors.margins: 4
anchors.fill: parent
spacing: 8;
*/
ColumnLayout {
Frame {
Layout.fillWidth: true
ListView {
implicitWidth: 250
implicitHeight: 500
anchors.fill: parent
clip: true
//model: TestUserModel {
model: TableModel {
modelList: userList
}
delegate: ColumnLayout {
width: parent.width
RowLayout {
Label {
text: qsTr("userId")
}
TextField {
text: model.userId
onEditingFinished: model.userId = text
Layout.fillWidth: true
}
}
RowLayout {
Label {
text: qsTr("Firstname")
}
TextField {
text: model.firstName
onEditingFinished: model.firstName = text
Layout.fillWidth: true
}
}
RowLayout {
Label {
text: qsTr("Lastname")
}
TextField {
text: model.lastName
onEditingFinished: model.lastName = text
Layout.fillWidth: true
}
}
RowLayout {
Label {
text: qsTr("email")
}
TextField {
text: model.email
onEditingFinished: model.email = text
Layout.fillWidth: true
}
Label {
text: qsTr("Verified")
}
CheckBox {
checked: model.emailConfirmed
onClicked: model.emailConfirmed = checked
}
}
RowLayout {
Label {
text: qsTr("Initials")
}
TextField {
text: model.userInitials
onEditingFinished: model.userInitials = text
Layout.fillWidth: true
}
}
}
}
}
RowLayout {
Button {
text: qsTr("Add new item")
onClicked: userList.appendItem()
Layout.fillWidth: true
}
Button {
text: qsTr("Remove item")
onClicked: userList.removeItems()
Layout.fillWidth: true
}
}
}