/* * AdvoTracker - Hotline tracking tool for Advocats * * Copyright (c) 2017-2018 Ralf Zerres . */ import QtQuick 2.10 // Qt 5.10 import QtQuick.Controls 2.3 // Qt 5.10 import QtQuick.Layouts 1.3 // Qt 5.10 import QtQuick.Controls.Material 2.3 // Qt 5.10 // AdvoTracker Module import de.networkx.AdvoTracker 1.0 as Nwx import de.networkx.SqlUserModel 1.0 as Nwx import SortFilterProxyModel 0.2 Page { id: pageUserDetail leftPadding: 26 rightPadding: 26 topPadding: 18 bottomPadding: 18 property string userId header: ToolBar { Material.foreground: "white" Label { id: pageTitle text: qsTr("User details") //font.pointSize: 18 //font.pointSize: { // if (main_window.main_w < main_window.width) // return main_window.main_w / 35 // we need 20pt // return main_window.width / 35 //} anchors.centerIn: parent } ToolButton { text: Nwx.MdiFont.Icon.pencil + " " + qsTr("Edit") anchors.right: parent.right anchors.rightMargin: 10 anchors.verticalCenter: parent.verticalCenter onClicked: { //console.log("Mouse-Press: left; index:", index, "; userId:", filterModelUser.get(index).userId) //stackViewMain.push(componentEdit, { userId: filterModelUser.get(index).userId } ) console.log("Mouse-Press: left; userId:", userId) //stackViewMain.push(componentEdit, { userId: userId } ) stackViewMain.push("qrc:/pages/PageUserEdit.qml", { userId: userId } ) } } } // header ToolBar SortFilterProxyModel { id: filterModelUser sourceModel: modelUser filters: RegExpFilter { roleName: "userId" pattern: userId //caseSensitivity: Qt.CaseInsensitive } sorters: [ StringSorter { roleName: "userId" } ] } // filterModelUser Component { id: delegateUsersDetail Pane { id: paneUsersDetail anchors.fill: parent Layout.fillWidth: true //Layout.fillHeight: true leftPadding: 6 rightPadding: 6 topPadding: 6 bottomPadding: 6 ColumnLayout { id: columnUsersDetail width: parent.width anchors.topMargin: 12 spacing: 2 GroupBox { id: groupBoxUserDetail title: qsTr("User data") width: parent.width Layout.fillWidth: true ColumnLayout { id: columnUserDetail width: parent.width anchors.topMargin: 12 spacing: 2 RowLayout { Layout.fillWidth: true //spacing: 12 Label { Layout.preferredWidth: 120 text: qsTr("User-Id") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 } Label { //anchors.horizontalCenter: parent.horizontalCenter Layout.preferredWidth: 120 text: model.userId } } } RowLayout { Layout.fillWidth: true //spacing: 12 Label { Layout.preferredWidth: 120 text: qsTr("Lastname") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 } Label { text: model.lastName } } } RowLayout { Layout.fillWidth: true //spacing: 12 Label { Layout.preferredWidth: 120 text: qsTr("Firstname") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 } Label { text: model.firstName Layout.preferredWidth: 150 // width: 100; } } } RowLayout { //spacing: 12 Layout.fillWidth: true Label { Layout.preferredWidth: 120 text: qsTr("Email") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 } Label { text: model.email Layout.preferredWidth: 150 // width: 100; } } } RowLayout { //spacing: 12 Layout.fillWidth: true Label { Layout.preferredWidth: 120 text: qsTr("Intitials") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 } Label { text: model.initials //width: 50; } } } } // columnDetail } // groupBoxUserDetail GroupBox { id: groupBoxRoleDetail title: qsTr("User roles") width: parent.width Layout.fillWidth: true anchors.top: groupBoxUserDetail.bottom anchors.topMargin: 12 ColumnLayout { id: columnDetailRole width: parent.width anchors.topMargin: 12 spacing: 2 RowLayout { id: rowDetailRole Layout.fillWidth: true //spacing: 12 Label { Layout.preferredWidth: 120 text: qsTr("Role") } Pane { Layout.fillWidth: true background: Rectangle { color: "lightgrey" radius: 5 //border.width: 1 } Label { text: model.roleName } } } // rowRole } // columnDetail } // groupBoxRoleDetail } // columnUsersDetail } // paneUsersDetail } // delegateUsersDetail ListView { id: listUsersDetail anchors.fill: parent model: filterModelUser //header: headerUsersDetail //footer: footerUsersDetail delegate: delegateUsersDetail } // listUsersDetail } // pageUserDetail