advotracker_qml: advotracker variant with Qt/Qml GUI
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
134
advotracker_qml/resources/pages/UserRoleListPage.qml
Executable file
134
advotracker_qml/resources/pages/UserRoleListPage.qml
Executable file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 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
|
||||
import QtQml.Models 2.2
|
||||
|
||||
// AdvoTracker Module
|
||||
import de.networkx.AdvoTracker 1.0 as Nwx
|
||||
|
||||
Pane {
|
||||
id: paneUserRoleList
|
||||
|
||||
header: ToolBar {
|
||||
Label {
|
||||
text: qsTr("Available User Roles")
|
||||
font.pixelSize: 12
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: headerUserRoleList
|
||||
|
||||
Row {
|
||||
id: rowUserRoleListHeader
|
||||
//anchors.left: parent.left
|
||||
spacing: 6;
|
||||
|
||||
Nwx.Label {
|
||||
id: pkId
|
||||
Layout.minimumWidth: 10
|
||||
Layout.preferredWidth: 50
|
||||
text: userRoleModel.get(index).userRoleId
|
||||
}
|
||||
Text {
|
||||
id: roleId
|
||||
Layout.minimumWidth: 10
|
||||
Layout.preferredWidth: 50
|
||||
text: userRoleId
|
||||
}
|
||||
Text {
|
||||
id: roleName
|
||||
Layout.minimumWidth: 100
|
||||
Layout.preferredWidth: 120
|
||||
text: userRoleName
|
||||
}
|
||||
}
|
||||
} // headerUserRoleList
|
||||
|
||||
Component {
|
||||
id: delegateUserRoleList
|
||||
|
||||
delegate: ItemDelegate {
|
||||
//anchors.left: parent.left
|
||||
id: itemDelegateUserRole
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
Layout.preferredHeight: 60
|
||||
|
||||
spacing: 6
|
||||
|
||||
contentItem: Row {
|
||||
id: rowUserRole
|
||||
|
||||
//anchors.left: parent.left
|
||||
spacing: 6;
|
||||
|
||||
Text {
|
||||
id: pkId
|
||||
Layout.minimumWidth: 10
|
||||
Layout.preferredWidth: 50
|
||||
text: id
|
||||
}
|
||||
Text {
|
||||
id: roleId
|
||||
Layout.minimumWidth: 10
|
||||
Layout.preferredWidth: 50
|
||||
text: userRoleId
|
||||
}
|
||||
Text {
|
||||
id: roleName
|
||||
Layout.minimumWidth: 100
|
||||
Layout.preferredWidth: 120
|
||||
text: userRoleName
|
||||
}
|
||||
/*
|
||||
Label {
|
||||
id: roleName
|
||||
text: model.roleName
|
||||
}
|
||||
Label {
|
||||
id: dateChanged
|
||||
text: model.dateChanged
|
||||
}
|
||||
*/
|
||||
} // rowUserRole
|
||||
} // delegateUserRoleList
|
||||
|
||||
onClicked: {
|
||||
console.log("userRoleId:", userRoleModel.get(index).userRoleId, "; RoleName:", userRoleModel.get(index).userRoleName)
|
||||
}
|
||||
|
||||
} // delegateUserRoleList
|
||||
|
||||
ListView {
|
||||
id: listUserRoleList
|
||||
anchors.fill: parent
|
||||
model: {
|
||||
source: sourceModel.count > 0 ? sourceModel : nulluserRoleModel
|
||||
delegate: delegateUserRoleList
|
||||
header: headerUserRoleList
|
||||
highlight: hightlightUserRoleList
|
||||
} // listUserRoleList
|
||||
|
||||
} // paneUserRoleList
|
||||
}
|
||||
Reference in New Issue
Block a user