advotracker_qml: advotracker variant with Qt/Qml GUI

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-06-12 16:40:28 +02:00
parent 06cbce5c69
commit f41589263b
78 changed files with 13195 additions and 0 deletions

View File

@@ -0,0 +1,261 @@
/*
* 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
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
Page {
id: pageLogin
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
ColumnLayout {
id: columnLogin
width: parent.width
Layout.fillWidth: true
visible: true
/*
ListView {
width: 400; height: 400
model: 1
anchors.top: parent.top
delegate: userImage.mycomponent
UserImage {
id: userImage
anchors.horizontalCenter: parent.horizontalCenter
//Layout.alignment: Qt.AlignHCenter
}
}
*/
Nwx.IconLabel {
id: iconLogin
text: Nwx.MdiFont.Icon.account
anchors.top: parent.top
font.pixelSize: 96
anchors.horizontalCenter: parent.horizontalCenter
}
RowLayout {
id: rowLoginName
Layout.alignment: Qt.AlignHCenter
//anchors.horizontalCenter: parent.horizontalCenter
spacing: 12
Nwx.Label {
id: labelLogin
text: qsTr("User")
Layout.preferredWidth: implicitWidth
horizontalAlignment: TextInput.AlignHRight
}
Nwx.TextField {
id: loginName
Layout.alignment: Qt.AlignRight | Qt.AlignBaseline
Layout.preferredWidth: implicitWidth
placeholderText: qsTr("User Name")
Keys.onReturnPressed: loginPassword.forceActiveFocus()
onEditingFinished: {
// Assign password rows
if (loginName.text != null) {
rowLoginPassword.opacity = 1
} else {
confirmResult.text = qsTr("Please enter a username.");
confirmResult.opacity = 1;
confirmResult.color = "#ff0000";
}
}
}
} // rowLoginName
RowLayout {
id: rowLoginPassword
anchors.horizontalCenter: parent.horizontalCenter
spacing: 12
opacity: 0
Nwx.Label {
id: labelPassword
text: qsTr("Password")
Layout.preferredWidth: implicitWidth
horizontalAlignment: TextInput.AlignHRight
}
Nwx.TextField {
id: loginPassword
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
placeholderText: qsTr("Your Password")
echoMode: TextInput.Password
passwordMaskDelay: 1000
Keys.onReturnPressed: confirmPassword.forceActiveFocus()
onEditingFinished: {
if (loginPassword.text.length < 5) {
//confirmResult.text = qsTr("Please enter a valid password.")
confirmResult.text = qsTr("Given password does not fulfill given policy.")
confirmResult.color = "#ff0000"
loginPassword.forceActiveFocus()
confirmResult.opacity = 1
loginDialog.opacity = 0
} else {
rowConfirmPassword.opacity = 1
}
}
}
MouseArea {
id: loginPasswordMouse
onClicked: {
loginPassword.text = qsTr("new password");
loginPassword.echoMode = TextInput.Password;
}
}
} // rowLoginPassword
RowLayout {
id: rowConfirmPassword
anchors.horizontalCenter: parent.horizontalCenter
spacing: 12
opacity: 0
// Confirm password stuff
Nwx.Label {
id: labelConfirmPassword
text: qsTr("Confirm password")
Layout.preferredWidth: implicitWidth
horizontalAlignment: TextInput.AlignHRight
}
Nwx.TextField {
id: confirmPassword
placeholderText: qsTr("Confirm the password")
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
echoMode: TextInput.Password
passwordMaskDelay: 1000
//width: rowLoginPassword - 150
//renderType: Text.NativeRendering
//Layout.preferredWidth: rowConfirmPassword - 100
//Layout.minimumWidth: 150
//font.pointSize: 12
//horizontalAlignment: Text.AlignLeft
onEditingFinished: {
// Checks whether the password and its confirmation are the same.
if (loginPassword.text === confirmPassword.text) {
//confirmResult.text = qsTr("Password confirmed.")
loginDialog.opacity = 1.0
confirmResult.opacity = 0
confirmResult.color = "#00ff00"
} else {
confirmResult.text = qsTr("Please validate the password.")
confirmResult.opacity = 1.0
confirmResult.color = "#ff0000"
}
}
MouseArea {
anchors.fill: parent
onClicked: {
confirmPassword.text = ""
confirmPassword.echoMode = Nwx.TextField.Password
confirmPassword.focus = true
}
}
}
} // rowConfirmPassword
Text {
id: confirmResult
text: qsTr("Result")
anchors.top: rowConfirmPassword.bottom
anchors.horizontalCenter: iconLogin.horizontalCenter
opacity: 0
property color property0: "#00ff00"
//Layout.fillWidth: true
//anchors.topMargin: 16
//anchors.top: rowConfirmPassword.bottom
//anchors.left: rowConfirmPassword.left
//font.wordSpacing: -1
//renderType: Text.NativeRendering
//font.capitalization: Font.SmallCaps
//clip: false
}
ColumnLayout {
id: loginDialog
antialiasing: false
anchors.top: confirmResult.bottom
anchors.horizontalCenter: iconLogin.horizontalCenter
//anchors.bottomMargin: -130
spacing: 8
opacity: 0
RowLayout {
spacing: 10
Nwx.Button {
id: buttonApplyLogin
text: qsTr("Apply")
antialiasing: true
onPressed: {
// Checks whether the password and its confirmation are the same.
if (loginPassword.text === confirmPassword.text) {
confirmResult.text = qsTr("Password confirmed.");
confirmResult.opacity = 1;
confirmResult.color = "#00ff00";
} else {
confirmResult.text = qsTr("Given passwords do not match.");
confirmResult.opacity = 1;
confirmResult.color = "#ff0000";
}
}
} // buttonApplyLogin
Nwx.Button {
id: buttonClearLogin
text: qsTr("Clear")
antialiasing: true
onPressed: {
// Reset all dialog Fields
loginName.clear(),
loginPassword.clear(),
confirmPassword.clear(),
confirmResult.opacity = 0,
loginDialog.opacity = 0,
rowLoginPassword.opacity = 0,
rowConfirmPassword.opacity = 0;
}
} // buttonClearLogin
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,288 @@
/*
* 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
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
// adapted project module
import de.networkx.AdvoTracker 1.0 as Nwx
Page {
id: pageNewUser
property alias pageNewUser: pageNewUser
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
ColumnLayout {
id: columnUser
width: parent.width
visible: true
spacing: 8
Rectangle {
id: imageRoot;
anchors.horizontalCenter: parent.horizontalCenter
width: 96
height: 96
radius: 48
// apply rounded corners mask
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
x: imageRoot.x; y: imageRoot.y
width: imageRoot.width
height: imageRoot.height
radius: imageRoot.radius
}
}
Image {
id: imageLogin
opacity: 1
smooth: false
anchors.fill: parent
source: "/images/background.jpg"
}
}
RowLayout {
id: rowUserName
spacing: 5
//width: 300
/*
anchors.left: imageRoot.left
anchors.leftMargin: -((rowUserName.width / 2) - (image.width / 2))
anchors.bottom: imageRoot.bottom
anchors.bottomMargin: -64
*/
Nwx.Label {
id: labelUser
//width: 200
text: qsTr("User")
Layout.minimumWidth: 200
Layout.preferredWidth: 150
Layout.alignment: Qt.AlignRight | Qt.AlignBaseline
//font.pointSize: 12
//horizontalAlignment: Text.AlignLeft
}
Nwx.TextField {
id: userName
width: rowUserName - 100
renderType: Text.NativeRendering
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
Layout.preferredWidth: rowUserName - 100
Layout.minimumWidth: 150
placeholderText: qsTr("User Name")
Keys.onReturnPressed: userPassword.forceActiveFocus()
onEditingFinished: {
// Assign password rows
if (userName.text != null) {
// TODO: Verify if user is known
//confirmResult.text = qsTr("Check if username already exists.");
rowUserPassword.opacity = 1
} else {
confirmResult.text = qsTr("Please enter a username.");
confirmResult.opacity = 1;
confirmResult.color = "#6f1a32";
}
}
}
}
RowLayout {
id: rowUserPassword
//width: 300
//anchors.topMargin: 16
//anchors.top: rowUserName.bottom
//anchors.left: rowUserName.left
spacing: 4
opacity: 0
Nwx.Label {
id: labelPassword
y: 10
//width: 200
text: qsTr("Password")
Layout.minimumWidth: 200
Layout.preferredWidth: 150
Layout.alignment: Qt.AlignRight | Qt.AlignBaseline
//horizontalAlignment: Text.AlignLeft
}
Nwx.TextField {
id: userPassword
width: rowUserPassword - 150
renderType: Text.NativeRendering
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
Layout.preferredWidth: rowUserPassword - 100
Layout.minimumWidth: 150
horizontalAlignment: Text.AlignLeft
//text: qsTr("Enter your password")
placeholderText: qsTr("Your Password")
echoMode:TextInput.Password
Keys.onReturnPressed: confirmPassword.forceActiveFocus()
passwordMaskDelay: 1000
onEditingFinished: {
// Assign password rows
if (userPassword.text.length < 5) {
rowConfirmPassword.opacity = 1;
} else {
confirmResult.text = qsTr("Please enter a valid password.");
confirmResult.opacity = 1;
confirmResult.color = "#6f1a32";
userPassword.forceActiveFocus();
}
}
}
}
RowLayout {
id: rowConfirmPassword
//width: 300
//anchors.topMargin: 16
//anchors.top: rowUserPassword.bottom
//anchors.left: rowUserPassword.left
spacing: 4
opacity: 0
// Confirm password stuff
Nwx.Label {
id: labelConfirmPassword
anchors.right: confirmPassword.left
y: 10
text: qsTr("Confirm password")
Layout.minimumWidth: 200
Layout.preferredWidth: 150
Layout.alignment: Qt.AlignRight | Qt.AlignBaseline
//horizontalAlignment: Text.AlignLeft
}
Nwx.TextField {
id: confirmPassword
placeholderText: qsTr("Confirm the password")
width: rowUserPassword - 150
//anchors.left: labelConfirmPassword.left
renderType: Text.NativeRendering
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
Layout.preferredWidth: rowConfirmPassword - 100
Layout.minimumWidth: 150
font.pointSize: 12
horizontalAlignment: Text.AlignLeft
echoMode: TextInput.Password
Keys.onReturnPressed: buttonApply.forceActiveFocus()
onEditingFinished: {
if (userPassword.text !== confirmPassword.text) {
confirmResult.text = qsTr("Given passwords do not match.");
confirmResult.opacity = 1;
confirmResult.color = "#6f1a32";
loginDialog.opacity = 0
} else {
confirmResult.text = qsTr("Password confirmed.");
confirmResult.opacity = 1.0;
confirmResult.color = "#00ff00";
loginDialog.opacity = 1.0
}
}
}
// Your text color box
Text {
id: confirmResult
Layout.alignment: Qt.AlignLeft | Qt.AlignBaseline
font.pointSize: 12
text: qsTr("Result");
font.wordSpacing: -1
renderType: Text.NativeRendering
//font.capitalization: Font.SmallCaps
clip: false
opacity: 0
property color property0: "#00ff00"
Layout.fillWidth: true
}
}
Column {
id: loginDialog
antialiasing: false
//anchors.bottom: rowConfirmPassword.top
//anchors.bottomMargin: -130
//anchors.horizontalCenter: imageRoot.horizontalCenter
spacing: 8
opacity: 0
RowLayout {
spacing: 10
Button {
id: buttonApply
text: qsTr("Apply")
antialiasing: true
signal qmlSignal(var anObject)
onPressed: {
/*
// Checks whether the password and its confirmation are the same.
if (userPassword.text === confirmPassword.text) {
confirmResult.text = qsTr("Password confirmed.");
confirmResult.opacity = 1;
confirmResult.color = "#00ff00";
} else {
confirmResult.text = qsTr("Given passwords do not match.");
confirmResult.opacity = 1;
confirmResult.color = "#ff0000";
}
*/
//stack.push({item:"qrc:/pages/StackLayout.qml"});
//_cppApi.cppSlot("Hello")
_myClass.cppSlot("Apply")
} // onPressed
}
Button {
id: buttonClear
text: qsTr("Clear")
antialiasing: true
signal qmlSignal(var anObject)
onPressed: {
// Reset all dialog Fields
userName.clear(),
userPassword.clear(),
confirmPassword.clear(),
confirmResult.opacity = 0,
loginDialog.opacity = 0,
rowUserPassword.opacity = 0,
rowConfirmPassword.opacity = 0;
//clearButton.qmlSignal(clearButton)
_myClass.cppSlot("Clear")
}
}
}
}
}
}

View File

@@ -0,0 +1,267 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
/**
* @brief Add relevant NumberHarm informations to db
* @param numberHarm - Schadensnummer
* @param namePolicyowner - Names Versicherungsnehmers
* @param numberPolicyholder - Policennummer des Versicherungsnehmers
* @param switchSB - Selbstbeteiligung
* @param switchSecurity - Deckung
* @param harmReport - Sachverhalt
* @param rightsCouncil - Rechtsrat
* @param switchDone - Erledigt
* @param switchCME - Zentrale Mandats Bearbeitung
* @param switchSurcharge - Zuschlag
* @param numberCallback - Rückrufnummer
* @param dateCallback - Rückrufdatum
* @param dateRecorded - Schadensdatum
* @param clerkId - Id des Benutzer
*
* @return QSqlError
*/
/**
* @brief Add relevant NumberHarmHistory informations to db
* @param numberHarm - Schadensnummer
* @param dateChanged - Änderungsdatum des Datensatzes
* @param userIdChanged - Änderung durch UserId
*
* @return QSqlError
*/
Page {
id: pageNumberHarm
property string numberHarm
property bool doneCME: false
/*
ListModel {
id: modelSwipeTypes
ListElement { itemType: "NumberHarmData"; itemSource: "PaneNumberHarmData.qml"; title: qsTr("Data") }
ListElement { itemType: "NumberHarmAdmin"; itemSource: "PaneNumberHarmAdmin.qml"; title: qsTr("Admin") }
} // modelSwipeTypes
*/
Action {
id: actionNumberHarmData
shortcut: "Ctrl+H"
//onTriggered: Loader {//id: paneNumberHarmBase; source: "PaneNumberHarmBase.qml" }
onTriggered: {
//loaderNumberHarmData.source = "qrc:/pages/PaneNumberHarmData.qml"
swipeNumberHarm.setCurrentIndex(0)
console.log(shortcut)
console.log("numberHarm:", numberHarm)
//console.log(loaderNumberHarmData.source)
//swipeNumberHarm.currentIndex = 0;
//swipeView.currentIndex = Qt.binding(function() {return tabBar.currentIndex})
//modelSwipeTypes.append({ "itemType": "NumberHarmExtended2", "itemSource": "PaneNumberHarmExtended.qml", "title": "Extended2" })
//console.log("itemSource: " + modelSwipeTypes.get(0).itemSource)
//modelSwipeTypes.remove(2)
//modelSwipeTypes.append({ "itemType": "NumberHarmExtended", "itemSource": "PaneNumberHarmExtended.qml", "title": "Extended" })
//console.log("itemSource: " + modelSwipeTypes.get(2).itemSource)
//modelSwipeTypes.remove(2)
//swipeView.currentIndex = 0;
//swipeView.currentIndex = Qt.binding(function() {return tabBar.currentIndex})
}
} // actionNumberHarmData
Action {
id: actionNumberHarmAdmin
shortcut: "Ctrl+D"
//onTriggered: stackViewMain.push("qrc:/NumberHarmPageHistory.qml", { numberHarm: filterModelUser.get(index).numberHarm } )
//onTriggered: stackViewMain.push("qrc:/pages/NumberHarmPageHistory.qml", { numberHarm: "47114711" } )
//onTriggered: Loader { source: "PaneNumberHarmHistory.qml" }
onTriggered: {
//loaderNumberHarmAdmin.source = "qrc:/pages/PaneNumberHarmAdmin.qml"
//swipeNumberHarm.incrementCurrentIndex()
swipeNumberHarm.setCurrentIndex(1)
console.log(shortcut)
//console.log(loaderNumberHarmAdmin.source)
}
} // actionNumberHarmAdmin
header: TabBar {
id: tabBar
//tabView: tabframe
width: parent.width
position: TabBar.Header
contentWidth: 150
padding: 4
spacing: 8
antialiasing: true
//font.pointSize: 12
wheelEnabled: false
background: Rectangle {
//color: tabbar.down ? "#d6d6d6": "#f6f6f6"
border.width: 1
radius: 4
}
currentIndex: swipeNumberHarm.currentIndex
onCurrentIndexChanged: {
swipeNumberHarm.currentIndex = currentIndex
}
TabButton {
//text: Nwx.MdiFont.Icon.helpCircleOutline + " " + qsTr("&Base")
text: qsTr("&Harm data")
action: actionNumberHarmData
}
TabButton {
//text: Nwx.MdiFont.Icon.helpCircleOutline + " " + qsTr("&History")
text: qsTr("Administative &data")
action: actionNumberHarmAdmin
}
} // tabBar
SwipeView {
id: swipeNumberHarm
anchors.fill: parent
Layout.fillWidth: true
Layout.preferredHeight: pageNumberHarm.height * .9
//Layout.fillHeight: true
currentIndex: tabBar.currentIndex
onCurrentIndexChanged: {
tabBar.currentIndex = currentIndex
}
Loader {
id: loaderNumberHarmData
//active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
//source: "PaneNumberHarmData.qml"
sourceComponent: PaneNumberHarmData {
//numberHarm: numberHarm
Component.onCompleted: {
console.log("create: PaneNumberHarmData")
console.log("numberHarm:", numberHarm)
}
Component.onDestruction: console.log("destroyed: PaneNumberHarmData ")
}
//asynchronous: true
//visible: status == Loader.Ready
} // paneNumberHarmHistory
Loader {
id: loaderNumberHarmAdmin
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
//active: swipeNumberHarm.isCurrentItem || swipeNumberHarm.isNextItem || swipeNumberHarm.isPreviousItem
sourceComponent: PaneNumberHarmAdmin {
//numberHarm: numberHarm
Component.onCompleted: {
console.log("create: PaneNumberHarmAdmin")
console.log("numberHarm:", numberHarm)
}
Component.onDestruction: console.log("destroyed: PaneNumberHarmAdmin")
}
//source: "PaneNumberHarmAdmin.qml"
//asynchronous: true
//visible: status == Loader.Ready
} // paneNumberHarmHistory
/*
Repeater {
id: repeater
model: 2
delegate: ListView {
id: listNumberHarm
anchors.fill: parent
property int listNumberHarmIndex: index
// simple model
model: SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: RegExpFilter {
// useRole
roleName: "numberHarm"
pattern: numberHarm
//pattern: "account"
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [ StringSorter { roleName: "numberHarm" } ]
} // model: filterNumberHarmClerk
delegate:
PaneNumberHarmData {}
//Loader {
// source: "qrc:/pages/PaneNumberHarmAdmin.qml"
//}
} // paneNumberHarmBase
}
*/
//Connections {
// target: paneNumberHarmBase.item
// onMessage: console.log(msg)
//}
/*
ListView {
id: listNumberHarm
//anchors.fill: parent
//currentIndex: 1
model: SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: RegExpFilter {
// useRole
roleName: "numberHarm"
pattern: numberHarm
//pattern: "account"
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [ StringSorter { roleName: "numberHarm" } ]
} // filterNumberHarm
//delegate: paneNumberHarmBase.source: "PaneNumberHarmBase.qml"
paneNumberHarmData.source = "PaneNumberHarmData.qml"
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
}
*/
} // swipeNumberHarm
PageIndicator {
id: indicatorNumberHarm
count: swipeNumberHarm.count
currentIndex: swipeNumberHarm.currentIndex
anchors.bottom: swipeNumberHarm.bottom
anchors.horizontalCenter: parent.horizontalCenter
} // indicatorNumberHarm
} // pageNumberHarm

View File

@@ -0,0 +1,793 @@
/* AdvoTracker - Hotline tackingtool for Advocats
*
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
* SPDX-License-Identifier: (0BSD or MIT)
*
* Based on an example from https://github.com/woboq/qmetaobject-rs/tree/master/examples
* Copyright 2019 Olivier Goffart <ogoffart@woboq.com>
*
*/
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 Modules
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
Page {
id: pageNumberHarmList
//padding: 12
//Material.theme: Material.System
//Material.theme: Material.Light
//rightPadding: 24
// include AdvoTracker Type 'SearchToolBar'
header: SearchToolBar {
id: searchToolBar
// search field: searchToolBar.text
Material.foreground: "white"
Layout.fillWidth: true
focus:true
onFocusChanged: console.log("searchToolBar: Focus changed " + focus)
/*
Keys.onPressed: {
if (event.key == Qt.Key_Ctrl + Qt.Key_S) {
console.log("search");
event.accepted = true;
}
}
*/
}
// simple Filter as starter ...
SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: [
ValueFilter {
//enabled: onlyShowFavoritesCheckbox.checked
roleName: "numberHarm"
//value: "Administrator"
//value: "*"
},
AnyOf {
RegExpFilter {
roleName: "numberHarm"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
RegExpFilter {
roleName: "numberPolicyholder"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
}
]
sorters: [
//RoleSorter { roleName: "userId"; sortOrder: Qt.DescendingOrder },
RoleSorter { roleName: "clerkId"; sortOrder: Qt.AscendingOrder },
StringSorter { roleName: "dateRecored"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "numberPolicyholder" }
]
} // filterNumberHarm
/* complex filter with two roles
SortFilterProxyModel {
id: filterComplex
sourceModel: modelNumberHarm
sorters: [
RoleSorter { roleName: "numberHarm"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "numberHarm" }
]
filters: RegExpFilter {
id: nameFilter
roleName: "numberHarm"
enable: textSearch.nameFilter
//pattern: searchToolBar.text
pattern: "^" + searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
proxyRoles: SwitchRole {
name: "sectionRole"
filters: RegExpFilter {
roleName: "numberHarm"
enable: search
value: true
SwitchRole.value: "*"
}
defaultRoleName: "numberHarm"
}
}
*/
// simple filter: one role, given explicit search pattern
/*
SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: [
ValueFilter {
//enabled: onlyShowFavoritesCheckbox.checked
roleName: "numberHarm"
value: "47114711"
//value: "*"
},
AnyOf {
RegExpFilter {
roleName: "numberHarm"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
RegExpFilter {
roleName: "numberPolicyholder"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
}
]
sorters: [
RoleSorter { roleName: "numberHarm"; sortOrder: Qt.AscendingOrder },
//StringSorter { roleName: "numberHarm", "clerkId" }
StringSorter { roleName: "numberPolicyholder" }
]
} // filterNumberHarm
*/
Component {
id: headerNumberHarmList
Pane {
id: frameHeaderNumberHarmList
Layout.fillWidth: true
width: parent.width
Material.background: Material.color(Material.Grey)
RowLayout {
id: rowHeaderNumberHarmList
spacing: 8
width: parent.width
//anchors.verticalCenter: parent.verticalCenter
//anchors.right: parent.right
Layout.fillWidth: true
//Material.foreground: Material.accent
Label {
id: labelHeaderNumberHarm
text: qsTr("Number harm")
//font.pixelsize: 18
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 150
anchors.left: parent.left
}
Label {
id: labelHeaderNumberPolicyholder
text: qsTr("Number policyholder")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.fillWidth: true
Layout.preferredWidth: 300
Layout.minimumWidth: 300
}
Label {
id: labelHeaderClerkId
text: qsTr("Clerk Id")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.fillWidth: true
Layout.preferredWidth: 80
Layout.minimumWidth: 80
}
Label {
id: labelHeaderDateRecorded
text: qsTr("Date recorded")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 200
Layout.minimumWidth: 200
anchors.left: labelHeaderClerkId.right
anchors.right: parent.right;
//anchors.right: rowHeaderNumberHarmList.right
}
} // rowHeaderNumberHarmList
} // frameHeaderNumberHarmList
} // headerNumberHarmList
Component {
id: footerNumberHarmList
Rectangle {
id: root
width: ListView.view.width
height: 20
//color: "#ffffff"
//border.color: Qt.darker(color, 1.2)
property alias text: label.text
property color fontColor: '#1f1f1f'
Text {
id: label
anchors.centerIn: parent
//font.pixelSize: 14
color: root.fontColor
text: qsTr("List ends here")
}
}
} // footerNumberHarmList
Component {
id: highlightNumberHarmList
Item {
width: listNumberHarmList.width
height: listNumberHarmList.currentItem.height
y: listNumberHarmList.currentItem.y
Behavior on y {
SequentialAnimation {
PropertyAnimation {
target: rectangleHeighlight
property: "opacity"
to: 0
duration: 500
}
NumberAnimation { duration: 5 }
PropertyAnimation {
target: rectangleHeighlight
property: "opacity"
to: 1
duration: 200
}
//SpringAnimation { spring: 2; damping: 0.1 }
}
}
Rectangle {
id: rectangleHeighlight
width: listNumberHarmList.width
height: listNumberHarmList.currentItem.height
anchors.fill: parent
anchors.margins: 5
color: "lightsteelblue"
radius: 5
} // Rectangle
} // Item
} // highlightNumberHarmList
Component {
id: delegateNumberHarmList
ItemDelegate {
id: itemNumberHarmList
Layout.fillWidth: true
width: parent.width
anchors.right: parent.fill
focus: true
contentItem: RowLayout {
id: rowNumberHarmList
spacing: 8
anchors.horizontalCenter: parent.horizontalCenter
focus: true
Label {
id: numberHarm
text: model.numberHarm
Layout.preferredWidth: 150
}
Label {
id: numberPolicyholder
text: model.numberPolicyholder
Layout.preferredWidth: 300
Layout.minimumWidth: 300
Layout.fillWidth: true
//width: labelHeaderNumberPolicyholder.width
//Layout.preferredWidth: labelHeaderNumberPolicyholder.width
}
Label {
id: clerkId
text: model.clerkId
Layout.preferredWidth: 80
Layout.minimumWidth: 80
Layout.fillWidth: true
//width: labelHeaderNumberPolicyholder.width
//Layout.preferredWidth: labelHeaderNumberPolicyholder.width
}
Label {
id: dateRecorded
text: Qt.formatDateTime(model.dateRecorded, "ddd dd.MM.yyyy hh:mm")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 200
Layout.minimumWidth: 200
anchors.left: clerkId.right
anchors.right: parent.right;
}
} // rowNumberHarmList (contentItem)
// adapt the current item
states: State {
name: "Current"
when: itemNumberHarmList.ListView.isCurrentItem
PropertyChanges { target: numberHarm ; color: Material.color(Material.primary, Material.ShadeA700) }
//PropertyChanges { target: numberPolicyholder ; color: Material.color(Material.accent, Material.ShadeA700) }
}
transitions: Transition {
NumberAnimation { properties: "color"; duration: 200 }
SpringAnimation { spring: 2; damping: 0.1 }
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onPressed: {
console.log("Mouse-Press: left; index:", index, "; iconName:", filterNumberHarm.get(index).numberHarm)
itemNumberHarmList.ListView.view.currentIndex = index
}
onDoubleClicked: {
console.log("Mouse-Press: double; index:", index, "; numberHarm:", filterNumberHarm.get(index).numberHarm)
console.log("Mouse-Press: double; index:", index, "; userId:", filterNumberHarm.get(index).clerkId)
// stackViewMain.push(componentDetail, { numberHarm: filterNumberHarm.get(index).numberHarm } )
stackViewMain.push("qrc:/pages/PageNumberHarm.qml", { numberHarm: filterNumberHarm.get(index).numberHarm } )
//Loader { id: pagePolicy, source: "qrc:/PolicyPage.qml" }
}
} // MouseArea
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: {
console.log("Mouse-Press: right; index:", index, "; numberHarm:", filterNumberHarm.get(index).numberHarm)
itemNumberHarmList.ListView.view.currentIndex = index
}
} // MouseArea
Shortcut {
context: Qt.ApplicationShortcut
sequence: [ StandardKey.NextChild, "Ctrl+N" ]
// onActivated: view.currentIndex++
onActivated: itemNumberHarmList.ListView.view.currentIndex++
}
Keys.onReturnPressed: {
console.log("Key-Press: retrun; index:", index, "; iconName:", filterNumberHarm.get(index).numberHarm)
itemNumberHarmList.ListView.view.currentIndex = index
stackViewMain.push(componentDetail, { numberHarm: "filterNumberHarm.get(index).numberHarm" } )
}
Keys.onTabPressed: {
// Windows: Ctrl-Tab, Alt+Right, Ctrl-F6
// Gnome: Ctrl-Tab
console.log("Key-Press: Tab; index:", index, "; iconName:", filterNumberHarm.get(index).numberHarm)
itemNumberHarmList.ListView.view.currentIndex = index + 1
}
Keys.onBacktabPressed: {
// Windows: Ctrl-Shift-Tab, Alt+Left, Ctrl-Shift-F6
// Gnome: Ctrl-Shift-Tab, Alt+Left
console.log("Key-Press: Backtab (Shift+tab); index:", index, "; iconName:", filterNumberHarm.get(index).numberHarm)
itemNumberHarmList.ListView.view.currentIndex = index -1
}
} // itemNumberHarmList
} // delegateNumberHarmList
// just here for testing!!!
Component {
// called via: stackViewMain.push(componentDetail)
id: componentDetail
Page {
id: pageDetail
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
property string userId
header: ToolBar {
Material.foreground: "white"
ToolButton {
text: Nwx.MdiFont.Icon.pencil + " " + qsTr("Edit")
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: {
console.log("Mouse-Press: left; index:", index, "; userId:", filterNumberHarm.get(index).userId)
stackViewMain.push(componentEdit, { userId: filterNumberHarm.get(index).userId } )
}
}
Label {
id: pageTitle
text: qsTr("Show Number harm detail")
//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
}
} // header
ColumnLayout {
id: columnDetail
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
//anchors.right: parent.fill
ListView {
id: listDetail
anchors.fill: parent
//Layout.fillWidth: true
//Layout.fillHeight: true
//Layout.margins: 12
//displayMarginBeginning: 40
//displayMarginEnd: 40
// simple model
model: SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: RegExpFilter {
// useRole
roleName: "numberHarm"
pattern: numberHarm
//pattern: "account"
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [
RoleSorter { roleName: "numberHarm"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "dateRecording"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "clerkId" }
]
} // model: filterNumberHarm
//header: headerDetail
//footer: footerDetail
delegate: Pane {
id: paneDetails
anchors.fill: parent
Layout.fillWidth: true
//Layout.fillWidth: true
//Layout.fillHeight: true
leftPadding: 6
rightPadding: 6
topPadding: 6
bottomPadding: 6
ColumnLayout {
id: columnDetail
width: parent.width
anchors.topMargin: 12
spacing: 2
GroupBox {
id: groupDetailNumberHarm
title: qsTr("Number harm data")
width: parent.width
Layout.fillWidth: true
ColumnLayout {
id: columnDetailNumberHarm
width: parent.width
anchors.topMargin: 12
spacing: 2
RowLayout {
Layout.fillWidth: true
//spacing: 12
Label {
Layout.preferredWidth: 160
text: qsTr("Number harm")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Label {
//anchors.horizontalCenter: parent.horizontalCenter
Layout.preferredWidth: 120
text: numberHarm
}
}
}
RowLayout {
Layout.fillWidth: true
//spacing: 12
Label {
Layout.preferredWidth: 160
text: qsTr("Number policyholder")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Label {
text: numberPolicyholder
}
}
}
RowLayout {
Layout.fillWidth: true
//spacing: 12
Label {
Layout.preferredWidth: 160
text: qsTr("Date recorded")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Label {
text: dateRecording
Layout.preferredWidth: 150
// width: 100;
}
}
}
} // columnDetail
} // groupDetailNumberHarm
GroupBox {
id: groupDetailRole
title: qsTr("User data")
width: parent.width
Layout.fillWidth: true
ColumnLayout {
id: columnDetailRole
width: parent.width
anchors.topMargin: 12
spacing: 2
RowLayout {
id: rowDetailRole
Layout.fillWidth: true
//spacing: 12
Label {
Layout.preferredWidth: 160
text: qsTr("User Id")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Label {
text: userId
}
}
} // rowRole
} // columnDetail
} // groupDetailRole
} // paneDetail (contentItem)
} // columnDetailNumberHarm
} // listDetail
} // columnDetail
} // pageDetail
} // componentDetail
Component {
// called via: stackViewMain.push(pageEdit)
id: componentEdit
Page {
id: pageEdit
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
property string numberHarm
header: ToolBar {
Material.foreground: "white"
ToolButton {
text: Nwx.MdiFont.Icon.settings + " " +qsTr("Edit")
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: stackViewMain.push(componentEdit)
}
Label {
id: pageTitle
text: qsTr("Edit user details")
font.pixelSize: 20
anchors.centerIn: parent
}
} // header
ColumnLayout {
id: columnEdit
anchors.right: parent.fill
ListView {
id: listEdit
anchors.fill: parent
spacing: 20
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 6
//displayMarginBeginning: 40
//displayMarginEnd: 40
// simple model
model: SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: RegExpFilter {
// useRole
roleName: "numberHarm"
pattern: numberHarm
//pattern: "account"
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [ StringSorter { roleName: "numberHarm" } ]
} // model: filterNumberHarm
//header: headerEdit
//footer: footerEdit
delegate: ColumnLayout {
id: columnEdits
//anchors.right: parent.right
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 12
GroupBox {
id: groupEdit
title: qsTr("Number harm data")
width: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
Label {
text: qsTr("User-Id")
}
Text {
//anchors.horizontalCenter: parent.horizontalCenter
text: userId
width: 50
}
}
RowLayout {
Label {
text: qsTr("Role")
}
Text {
text: roleName
//width: 150;
}
}
RowLayout {
Label {
text: qsTr("Lastname")
}
Text {
text: lastName
// width: 120
}
}
RowLayout {
Label {
text: qsTr("Firstname")
}
Text {
text: firstName
// width: 100;
}
}
RowLayout {
Label {
text: qsTr("Email")
}
Text {
text: email
// width: 100;
}
}
RowLayout {
Label {
text: qsTr("Intitials")
}
Text {
text: userInitials
//width: 50;
}
}
} // groupEdit
} // columnEdit (contentItem)
} // listEdit
} // columnEdit
} // pageEdit
} // componentEdit
ListView {
id: listNumberHarmList
anchors.fill: parent
anchors.rightMargin: 12
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 4
model: filterNumberHarm
//model: modelNumberHarm
delegate: delegateNumberHarmList
header: headerNumberHarmList
footer: footerNumberHarmList
highlight: highlightNumberHarmList
highlightFollowsCurrentItem: false
//focus: true
//contentWidth: headerNumberHarmList.width
flickableDirection: Flickable.VerticalFlick
/*
Keys.onPressed: {
console.log("list-item: " + event.key + " : " + event.text)
}
*/
Shortcut {
context: Qt.ApplicationShortcut
sequence: [ "Ctrl+S" ]
//onActivated: view.currentIndex++
onActivated: {
searchToolBar.forceActiveFocus()
console.log("Key-Press->Ctrl+S: Shortcut activated.")
}
}
Keys.onUpPressed: scrollBarNumberHarmList.decrease()
Keys.onDownPressed: scrollBarNumberHarmList.increase()
//Component.onCompleted: positionViewAtEnd()
//Component.onCompleted: positionViewAtIndex(ListView.Center)
ScrollBar.vertical: Nwx.ScrollBar {
id: scrollBarNumberHarmList
// leftPadding: 2
// topPadding: 2
// color: "lightsteelblue"
parent: listNumberHarmList.parent
anchors.top: listNumberHarmList.top
anchors.left: listNumberHarmList.right
anchors.bottom: listNumberHarmList.bottom
}
/*
ScrollIndicator.vertical: Nwx.ScrollIndicator {
id: scrollIndicatorNumberHarmList
leftPadding: 5
topPadding: 5
}
*/
} // listNumberHarmList
} // pageNumberHarmList

View File

@@ -0,0 +1,137 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
/**
* @brief Add relevant NumberHarm informations to db
* @param numberHarm - Schadensnummer
* @param numberPolicyholder - Policennummer des Versicherungsnehmers
* @param numberCallback - Rückrufnummer
* @param dateCallback - Rückrufdatum
* @param dateRecorded - Schadensdatum
* @param clerkId - integer representation of assigned cleark
*
* @return QSqlError
*/
Page {
id: pageNumberHarmStatic
// test with given numberHarm database entry
property string numberHarm: "47114711"
property bool doneCME: false
Action {
id: actionNumberHarmData
shortcut: "Ctrl+H"
onTriggered: {
//loaderNumberHarmData.source = "PaneNumberHarmData.qml"
loaderNumberHarmData.setSource("qrc:/pages/PaneNumberHarmData.qml", {"numberHarm": numberHarm});
swipeNumberHarm.setCurrentIndex(0)
console.log(shortcut)
console.log("numberHarm:", numberHarm)
console.log("loader.setSource: loaderNumberHarmData")
}
} // actionNumberHarmData
Action {
id: actionNumberHarmAdmin
shortcut: "Ctrl+D"
onTriggered: {
//loaderNumberHarmAdmin.source = "PaneNumberHarmAdmin.qml"
loaderNumberHarmAdmin.setSource("qrc:/pages/PaneNumberHarmAdmin.qml", {"numberHarm": numberHarm});
swipeNumberHarm.setCurrentIndex(1)
console.log(shortcut)
console.log("numberHarm:", numberHarm)
console.log("loader.setSource: loaderNumberHarmAdmin")
}
} // actionNumberHarmAdmin
header: TabBar {
id: tabBar
width: parent.width
position: TabBar.Header
contentWidth: 150
padding: 4
//font.pointSize: 12
wheelEnabled: false
spacing: 8
antialiasing: true
background: Rectangle {
//color: tabbar.down ? "#d6d6d6": "#f6f6f6"
border.width: 1
radius: 4
}
currentIndex: swipeNumberHarm.currentIndex
onCurrentIndexChanged: {
swipeNumberHarm.currentIndex = currentIndex
}
TabButton {
text: qsTr("&Harm data")
action: actionNumberHarmData
}
//TabButton {
// text: qsTr("Extended")
// action: actionPolicyExtended
//}
TabButton {
text: qsTr("Administative &data")
action: actionNumberHarmAdmin
}
} // tabBar
SwipeView {
id: swipeNumberHarm
anchors.fill: parent
Layout.fillWidth: true
Layout.preferredHeight: parent.height * 0.85
currentIndex: tabBar.currentIndex
//signal handlerLoader(string name, int index)
Loader {
// Declaration of a Loader. It will be activated later.
id: loaderNumberHarmData
focus: true
}
Loader {
// Declaration of a Loader. It will be activated later.
id: loaderNumberHarmAdmin
focus: true
}
} // swipeNumberHarm
PageIndicator {
id: indicatorPolicy
count: swipeNumberHarm.count
currentIndex: swipeNumberHarm.currentIndex
anchors.bottom: swipeNumberHarm.bottom
anchors.horizontalCenter: swipeNumberHarm.horizontalCenter
}
} // pagePolicy

View File

@@ -0,0 +1,139 @@
/*
* AdvoTracker - Hotline tracking tool 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
ItemDelegate {
id: itemUserList
Layout.fillWidth: true
width: parent.width
anchors.right: parent.fill
focus: true
contentItem: RowLayout {
id: rowUserList
spacing: 8
anchors.horizontalCenter: parent.horizontalCenter
//focus: true
Label {
id: userId
text: model.userId
Layout.preferredWidth: 150
}
Label {
id: userName
text: model.firstName + " " + model.lastName
Layout.fillWidth: true
}
/*
Nwx.IconButton {
id: valueUserList
text: model.userIcon
Layout.preferredWidth: 50
}
*/
} // rowUserList (contentItem)
// adapt the current item
states: State {
name: "Current"
when: itemUserList.ListView.isCurrentItem
PropertyChanges { target: userId ; color: Material.color(Material.primary, Material.ShadeA700) }
PropertyChanges { target: userName ; color: Material.color(Material.accent, Material.ShadeA700) }
}
transitions: Transition {
NumberAnimation { properties: "color"; duration: 200 }
SpringAnimation { spring: 2; damping: 0.1 }
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onPressed: {
console.log("Mouse-Press: left; index:", index, "; lastName:", filterModelUser.get(index).lastName)
/*PropertyChanges { target: nameUserList ; color: Material.color(Material.primary) }
PropertyChanges {
target: labelUserList
color: Material.color(Material.Red, Material.ShadeA700)
}
*/
itemUserList.ListView.view.currentIndex = index
}
onDoubleClicked: {
console.log("Mouse-Press: double; index:", index, "; lastName:", filterModelUser.get(index).lastName)
console.log("Mouse-Press: double; index:", index, "; userId:", filterModelUser.get(index).userId)
//stackViewMain.push(componentDetail, { userId: filterModelUser.get(index).userId } )
stackViewMain.push("qrc:/pages/PageUserDetail.qml", { userId: filterModelUser.get(index).userId } )
}
} // MouseArea
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: {
console.log("Mouse-Press: right; index:", index, "; userId:", filterModelUser.get(index).userId)
itemUserList.ListView.view.currentIndex = index
}
} // MouseArea
Keys.onPressed: {
console.log("list-item: " + event.key + " : " + event.text)
}
Shortcut {
context: Qt.ApplicationShortcut
sequence: [ StandardKey.Find ]
//onActivated: view.currentIndex++
onActivated: {
searchToolBar.forceActiveFocus()
console.log("Key-Press->Find: Shortcut activated.")
}
}
Keys.onUpPressed: {
console.log("Key-Press: Up; index:", index, "; UserId:", filterModelUser.get(index).userId)
//scrollBarUserList.decrease()
}
Keys.onDownPressed: scrollBarUserList.increase()
Keys.onReturnPressed: {
itemUserList.ListView.view.currentIndex = index
//stackViewMain.push(componentDetail, { userId: "filterModelUser.get(index).userId" } )
stackViewMain.push("qrc:/page/PageUserDetail.qml", { userId: filterModelUser.get(index).userId } )
}
Keys.onTabPressed: {
// Windows: Ctrl-Tab, Alt+Right, Ctrl-F6
// Gnome: Ctrl-Tab
console.log("Key-Press: Tab; index:", index, "; iconName:", filterModelUser.get(index).userId)
itemUserList.ListView.view.currentIndex = index + 1
}
Keys.onBacktabPressed: {
// Windows: Ctrl-Shift-Tab, Alt+Left, Ctrl-Shift-F6
// Gnome: Ctrl-Shift-Tab, Alt+Left
console.log("Key-Press: Backtab (Shift+tab); index:", index, "; iconName:", filterModelUser.get(index).userId)
itemUserList.ListView.view.currentIndex = index -1
}
} // itemUserList

View File

@@ -0,0 +1,262 @@
/*
* AdvoTracker - Hotline tracking tool for Advocats
*
* Copyright (c) 2017-2018 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 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

View File

@@ -0,0 +1,290 @@
/*
* AdvoTracker - Hotline tracking tool 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.10x
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
import de.networkx.BackendUser 1.0
import SortFilterProxyModel 0.2
Page {
id: pageUserEdit
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
BackendUser { id: backendUser }
property string userId
Action {
id: actionUserEditMenu
shortcut: "Ctrl+M"
onTriggered: menuUserEdit.open()
} // actionEditMenu
Action {
id: actionUserDelete
text: Nwx.MdiFont.Icon.deleteVariant + " " + qsTr("&Delete")
shortcut: StandardKey.delete
//shortcut: "Ctrl+D"
//onTriggered: window.activeFocusItem.cut()
} // actionDelete
Action {
id: actionUserNew
text: Nwx.MdiFont.Icon.accountSettingsVariant + " " + qsTr("&New")
shortcut: StandardKey.new
//onTriggered: stackViewMain.push(newUser)
} // actionNew
header: ToolBar {
Material.foreground: "white"
Label {
id: pageTitle
text: qsTr("Edit user details")
//font.pixelSize: 20
anchors.centerIn: parent
}
ToolButton {
text: Nwx.MdiFont.Icon.check + " " + qsTr("Save")
anchors.right: menuUserTop.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: {
/*
* update database for given index (userId)
* update the data model for given record
*/
console.log("Mouse-Press: left; update record for userId:", userId);
//modelUser.updateDatabase(userId.text, userEmail.text, userInitials.text, userLastName.text, userFirstName.text);
console.log("updateUserDetails for userId", userId, model.lastName, model.firstName, model.email, model.userInitials);
console.log(listView1.currentItem.userEmail.text)
/* db.updateUserDetails(userId, userEmail.text, userInitials.text, userLastName.text, userFirstName.text, userIdChanged.text);
* email, userInitials, lastName, firstName, userIdChanged
*/
}
}
ToolButton {
id: menuUserTop
text: Nwx.MdiFont.Icon.dotsVertical
font.pixelSize: 28
action: actionUserEditMenu
anchors.right: parent.right
Menu {
id: menuUserEdit
title: qsTr("Menu")
x: parent.width - width
transformOrigin: Menu.TopRight
MenuItem {
id: menuDelete
//title: Nwx.MdiFont.Icon.delete + " " + qsTr("Delete")
action: actionUserDelete
}
MenuItem {
id: menuNew
//title: Nwx.MdiFont.Icon.new + " " + qsTr("Delete")
action: actionUserNew
}
} // menuUserEdit
} // menuUserTop
} // header
SortFilterProxyModel {
id: filterModelUser
sourceModel: modelUser
filters: RegExpFilter {
roleName: "userId"
pattern: userId
//caseSensitivity: Qt.CaseInsensitive
}
sorters: [ StringSorter { roleName: "userId" } ]
} // filterModelUser
Component {
id: delegateUsersEdit
Pane {
id: paneUsersEdit
anchors.fill: parent
Layout.fillWidth: true
//Layout.fillHeight: true
leftPadding: 6
rightPadding: 6
topPadding: 6
bottomPadding: 6
GroupBox {
id: groupBoxUserEdit
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
}
Nwx.TextField {
id: userLastName
text: model.lastName
onEditingFinished: backendUser.lastName = text
Layout.fillWidth: true
}
}
}
RowLayout {
Layout.fillWidth: true
//spacing: 12
Label {
Layout.preferredWidth: 120
text: qsTr("Firstname")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Nwx.TextField {
id: userFirstName
text: model.firstName
onEditingFinished: backendUser.firstName = text
Layout.fillWidth: true
}
}
}
RowLayout {
//spacing: 12
Layout.fillWidth: true
Label {
Layout.preferredWidth: 120
text: qsTr("Email")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Nwx.TextField {
id: userEmail
text: model.email
onEditingFinished: backendUser.email = text
}
}
}
RowLayout {
//spacing: 12
Layout.fillWidth: true
Label {
Layout.preferredWidth: 120
text: qsTr("Intitials")
}
Pane {
Layout.fillWidth: true
background: Rectangle {
color: "lightgrey"
radius: 5
}
Nwx.TextField {
id: userInitials
text: model.initials
onEditingFinished: backendUser.initials = text
}
}
}
Button {
text: qsTr("Add")
// Update fields in the database
onClicked: {
console.log("updateUserDetails for userId", model.userId, "with:", userEmail.text, userInitials.text, userLastName.text, userFirstName.text);
//console.log("db.updateUserDetails(model.userId.text, model.userEmail.text, model.userInitials.text, model.userLastName.text, userFirstName.text");
//db.updateUserDetails(model.userId.text, model.userEmail.text, model.userInitials.text, model.userLastName.text, userFirstName.text);
//modelQueryUser.updateModel(model.userId.text)
//db.updateUserDetails(model.userId, model.userEmail.text, model.userInitials.text, model.userLastName.text, userFirstName.text);
//db.updateUserDetails(9999, "daniel@ra-hiedemann.de", "ddt", "Düsentrieb", "Daniel");
//listUsersEdit.model.updateDatabase(userId.text, userEmail.text, userInitials.text, userLastName.text, userFirstName.text);
modelUser.updateDatabase(userId, userEmail.text, userInitials.text, userLastName.text, userFirstName.text);
//modelUser.updateModel(model.userId);
}
}
} // columnDetail
} // groupBoxUserEdit
} // paneUsersEdit
} // delegateUsersEdit
ListView {
id: listUsersEdit
anchors.fill: parent
model: filterModelUser
//header: headerUsersEdit
//footer: footerUsersEdit
delegate: delegateUsersEdit
} // listUsersEdit
} // pageUserEdit

View File

@@ -0,0 +1,301 @@
/*
* AdvoTracker - Hotline tracking tool for Advocats
*
* Copyright (c) 2017-2018 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 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: pageUserList
//padding: 12
Material.theme: Material.System
//Material.theme: Material.Light
//rightPadding: 24
// include AdvoTracker Type 'SearchToolBar'
header: SearchToolBar {
id: searchToolBar
// search field: searchToolBar.text
Material.foreground: "white"
//font.pixelsize: 11
Layout.fillWidth: true
focus:true
onFocusChanged: console.log("searchToolBar: Focus changed " + focus)
//KeyNav.tabbacktabUp: searchToolBar.KeyNav.tabDown
//KeyNav.tabbacktabUp: rowUserList.KeyNav.tabDown
/*
Keys.onPressed: {
if (event.key == Qt.Key_Ctrl + Qt.Key_S) {
console.log("search");
event.accepted = true;
}
}
*/
}
/* complex filter with two roles
SortFilterProxyModel {
id: filterComplex
sourceModel: modelQueyUser
sorters: [
RoleSorter { roleName: "lastName"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "lastName" }
]
filters: RegExpFilter {
id: nameFilter
roleName: "lastName"
enable: textSearch.nameFilter
//pattern: searchToolBar.text
pattern: "^" + searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
proxyRoles: SwitchRole {
name: "sectionRole"
filters: RegExpFilter {
roleName: "lastName"
enable: search
value: true
SwitchRole.value: "*"
}
defaultRoleName: "lastName"
}
}
*/
// simple filter: one role, given explicit search pattern
SortFilterProxyModel {
id: filterModelUser
//sourceModel: modelQueryUser
sourceModel: modelUser
filters: [
ValueFilter {
//enabled: onlyShowFavoritesCheckbox.checked
//roleName: "roleName"
roleName: "userId"
//value: "Administrator"
//value: "1001"
},
AnyOf {
RegExpFilter {
roleName: "userId"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
RegExpFilter {
roleName: "lastName"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
RegExpFilter {
roleName: "firstName"
pattern: searchToolBar.text
caseSensitivity: Qt.CaseInsensitive
}
}
]
sorters: [
//RoleSorter { roleName: "userId"; sortOrder: Qt.DescendingOrder },
RoleSorter { roleName: "userId"; sortOrder: Qt.AscendingOrder },
StringSorter { roleName: "firstName" },
StringSorter { roleName: "lastName" }
]
}
Component {
id: headerUserList
Frame {
id: frameHeaderUserList
Layout.fillWidth: true
width: parent.width
height: 28
anchors.right: parent.fill
Material.background: Material.color(Material.Grey)
RowLayout {
id: rowHeaderUserList
spacing: 8
anchors.verticalCenter: parent.verticalCenter
//anchors.right: parent.right
Layout.fillWidth: true
Material.foreground: Material.accent
Label {
id: labelIndexHeaderUserList
text: qsTr("Id")
//font.pixelsize: 18
Layout.preferredWidth: 150
anchors.left: parent.left
}
Label {
id: labelNameHeaderUserList
text: qsTr("Username")
Layout.fillWidth: true
Layout.preferredWidth: 300
}
/*Label {
id: labelIconHeaderUserList
text: qsTr("Icon")
Layout.preferredWidth: 50
//anchors.right: parent.right
//anchors.right: rowHeaderUserList.right
}
*/
} // rowHeaderUserList
} // frameHeaderUserList
} // headerUserList
Component {
id: footerUserList
Rectangle {
id: root
width: ListView.view.width
height: 20
//color: "#ffffff"
//border.color: Qt.darker(color, 1.2)
property alias text: label.text
property color fontColor: '#1f1f1f'
Text {
id: label
anchors.centerIn: parent
//font.pixelSize: 14
color: root.fontColor
text: qsTr("List ends here")
}
}
} // footerUserList
Component {
id: highlightUserList
Item {
width: listUserList.width
height: listUserList.currentItem.height
y: listUserList.currentItem.y
Behavior on y {
SequentialAnimation {
PropertyAnimation {
target: rectangleHeighlight
property: "opacity"
to: 0
duration: 500
}
NumberAnimation { duration: 5 }
PropertyAnimation {
target: rectangleHeighlight
property: "opacity"
to: 1
duration: 200
}
//SpringAnimation { spring: 2; damping: 0.1 }
}
}
Rectangle {
id: rectangleHeighlight
width: listUserList.width
height: listUserList.currentItem.height
anchors.fill: parent
anchors.margins: 5
color: "lightsteelblue"
radius: 5
} // Rectangle
} // Item
} // highlightUserList
/*
Component {
id: delegateUserList
} // delegateUserList
*/
/*
Component {
// called via: stackViewMain.push(PageUserDetail)
id: componentUserDetail
} // componentUserDetail
*/
/*
Component {
// called via: stackViewMain.push(PageUserEdit)
id: componentUserEdit
} // componentUserEdit
*/
ListView {
id: listUserList
anchors.fill: parent
anchors.rightMargin: 12
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 4
model: filterModelUser
delegate: PageUserDelegate {}
//delegate: stackViewMain.push(PageUserDelegate)
//delegate: delegateUserList
header: headerUserList
footer: footerUserList
highlight: highlightUserList
highlightFollowsCurrentItem: false
//focus: true
//contentWidth: headerUserList.width
flickableDirection: Flickable.VerticalFlick
//Component.onCompleted: positionViewAtEnd()
//Component.onCompleted: positionViewAtIndex(ListView.Center)
ScrollBar.vertical: Nwx.ScrollBar {
id: scrollBarUserList
//leftPadding: 2
//topPadding: 2
parent: listUserList.parent
anchors.top: listUserList.top
anchors.left: listUserList.right
anchors.bottom: listUserList.bottom
}
/*
ScrollIndicator.vertical: Nwx.ScrollIndicator {
id: scrollIndicatorUserList
leftPadding: 5
topPadding: 5
}
*/
} // listUserList
} // pageUserList

View File

@@ -0,0 +1,289 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
Pane {
id: paneNumberHarmAdmin
Layout.fillWidth:true
leftPadding: 18
rightPadding: 18
topPadding: 18
bottomPadding: 18
ColumnLayout {
id: columnNumberHarmAdmin
width: parent.width
//anchors.topMargin: 12
spacing:25
GroupBox {
id: groupBoxDataAdmin
title: qsTr("Administative Data")
width: parent.width
//height: filterNumberHarmClerk.count * height + 2 * anchors.margins
height: Layout.preferredHeight
Layout.fillWidth: true
Layout.preferredHeight: 95
//Layout.preferredHeight: rowClerk.height + 12
Item {
focus: true
Keys.onPressed: {
console.log("KeyReader captured:",
event.text);
event.accepted = true;
}
}
SortFilterProxyModel {
id: filterNumberHarmClerk
sourceModel: modelNumberHarmClerk
filters: RegExpFilter {
roleName: "numberHarm"
pattern: numberHarm
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [ StringSorter { roleName: "clerkId" } ]
} // filterNumberHarmClerk
Component {
id: delegateDataAdmin
ItemDelegate {
id: itemNumberHarmList
Layout.fillWidth: true
width: parent.width
anchors.right: parent.fill
contentItem: RowLayout {
id: rowClerk
Layout.fillWidth: true
spacing: 6
Item {
id: itemWidth
property int labelWidth: 140
//property int textFieldWidth: 180
}
Nwx.Label {
id: labelClerkName
text: qsTr("Clerkname")
Layout.minimumWidth: 100
Layout.preferredWidth: itemWidth.labelWidth
//horizontalAlignment: Qt.AlignHRight
//verticalAlignment: Qt.AlignTop
} // labelClerkName
Nwx.Label {
id: clerkId
text: model.clerkId
//Layout.preferredWidth: itemWidth.labelWidth
//Layout.maximumWidth: itemWidth.labelWidth
} // clerkId
Nwx.Label {
id: clerkName
text: model.clerkFirstName + " " + model.clerkLastName
//Layout.preferredWidth: itemWidth.labelWidth
//Layout.maximumWidth: itemWidth.labelWidth
} // clerkName
} // rowClerk
} // itemNumberHarmList
} // delegateDataAdmin
ListView {
id: listNumberHarmClerk
anchors.fill: parent
Layout.fillWidth: true
//clip: true
property string numberHarm
//focus: true
model: filterNumberHarmClerk
delegate: delegateDataAdmin
//highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
} // listNumberHarmClerk
} // groupBoxDataAdmin
GroupBox {
id: groupBoxDataHistory
title: qsTr("Data history")
width: parent.width
height: Layout.preferredHeight
Layout.fillWidth: true
Layout.preferredHeight: 400
//anchors.top: groupBoxDataAdmin.bottom
//anchors.top: rowClerk.bottom
//anchors.topMargin: 18
//anchors.fill: parent
SortFilterProxyModel {
id: filterNumberHarmHistory
sourceModel: modelNumberHarmHistory
filters: RegExpFilter {
roleName: "numberHarm"
pattern: numberHarm
}
sorters: [
StringSorter { roleName: "dateChanged"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "userIdChanged"; sortOrder: Qt.AscendingOrder }
]
} // filterNumberHarmHistory
Component {
id: headerDataHistory
Pane {
id: frameHeaderDataHistory
Layout.fillWidth: true
//Layout.fillHeight: true
height: userIdChanged.implicitHeight * 0.9
width: parent.width
//anchors.top: groupBoxDataAdmin.bottom
//Material.background: Material.color(Material.Grey)
RowLayout {
id: rowHeaderDataHistory
spacing: 8
width: parent.width
//anchors.verticalCenter: parent.verticalCenter
Layout.fillWidth: true
//Material.foreground: Material.accent
Label {
id: labelHeaderDateChanged
text: qsTr("Date changed")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 200
Layout.minimumWidth: 200
//anchors.right: rowHeaderDataHistory.right
}
Label {
id: labelHeaderUserId
text: qsTr("Id")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 90
Layout.minimumWidth: 90
}
Label {
id: labelHeaderUserName
text: qsTr("User Name")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.fillWidth: true
Layout.preferredWidth: 180
Layout.minimumWidth: 180
anchors.left: labelHeaderUserId.right
anchors.right: parent.right;
}
} // rowHeaderDataHistory
} // frameHeaderDataHistory
} // headerDataHistory
Component {
id: delegateDataHistory
ItemDelegate {
id: itemDataHistory
Layout.fillWidth: true
height: userIdChanged.implicitHeight * 0.9 // or implicit height of children,
width: parent.width
anchors.right: parent.fill
focus: true
contentItem: RowLayout {
id: rowUser
Layout.fillWidth: true
spacing: 12
Nwx.Label {
id: dateChanged
text: Qt.formatDateTime(model.dateChanged, "ddd dd.MM.yyyy hh:mm")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 200
Layout.minimumWidth: 200
} // dateChanged
Nwx.Label {
id: userIdChanged
//Layout.preferredWidth: itemWidth.labelWidth
//Layout.maximumWidth: itemWidth.labelWidth
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: 90
Layout.minimumWidth: 90
text: model.userIdChanged
} // userName
Nwx.Label {
id: userName
Layout.preferredWidth: 180
Layout.minimumWidth: 180
Layout.fillWidth: true
text: model.userFirstName + " " + model.userLastName
//text: model.userId
anchors.left: userIdChanged.right
anchors.right: parent.right
} // userName
} // rowUser
} // itemDataAdmin
} // delegateDataHistory
ListView {
id: listNumberHarmHistory
anchors.fill: parent
anchors.rightMargin: 12
height: groupBoxDataHistory.height * 0.7
//anchors.top: groupBoxDataAdmin.bottom
//focus: true
clip: true
spacing: 1
model: filterNumberHarmHistory
header: headerDataHistory
delegate: delegateDataHistory
ScrollBar.vertical: Nwx.ScrollBar {
id: scrollBarNumberHarmHistory
// leftPadding: 2
// topPadding: 2
// color: "lightsteelblue"
parent: listNumberHarmHistory.parent
anchors.top: listNumberHarmHistory.top
anchors.left: listNumberHarmHistory.right
anchors.bottom: listNumberHarmHistory.bottom
}
} // listNumberHarmHistory
} // groupBoxDataHistory
} // columnNumberHarmAdmin
} // paneNumberHarmAdmin

View File

@@ -0,0 +1,976 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
Pane {
id: paneNumberHarmAdmin
Layout.fillWidth:true
//width: parent.width
leftPadding: 26
rightPadding: 26
topPadding: 18
bottomPadding: 18
ListView {
id: listNumberHarmData
anchors.fill: parent
property string numberHarm
//Layout.fillWidth: true
//Layout.fillHeight: true
//Layout.margins: 12
//displayMarginBeginning: 40
//displayMarginEnd: 40
model: SortFilterProxyModel {
id: filterNumberHarm
sourceModel: modelNumberHarm
filters: RegExpFilter {
// useRole
roleName: "numberHarm"
pattern: numberHarm
//caseSensitivity: Qt.CaseInsensitive
//caseSensitivity: Qt.Sensitive
}
sorters: [ StringSorter { roleName: "numberHarm" } ]
} // filterNumberHarm
delegate: delegateNumberHarmData
}
Component {
id: delegateNumberHarmData
Pane {
id: paneNumberHarmData
//Layout.fillWidth: true
width: parent.width
leftPadding: 18
rightPadding: 18
topPadding: 18
bottomPadding: 18
property string numberHarm
Item {
id: itemWidth
property int labelWidth: 140
property int textFieldWidth: 300
}
GroupBox {
id: groupBoxBaseData
title: qsTr("Base data")
width: parent.width
Layout.fillWidth: true
RowLayout {
id: rowBoxBaseData
spacing: 12
Pane {
id: groupBoxKeyData
//title: qsTr("Key data")
anchors.fill: parent
ColumnLayout {
id: columnBaseData
width: parent.width
anchors.topMargin: 12
spacing: 16
RowLayout {
id: rowNumberHarm
//width: parent.width
Layout.fillWidth: true
//visible: true
spacing: 12
Nwx.Label {
id: labelNumberHarm
Layout.minimumWidth: 100
Layout.preferredWidth: itemWidth.labelWidth
text: qsTr("Harm number")
//"Schadensnummer"
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
}
Nwx.TextField {
id: numberHarm
Layout.preferredWidth: itemWidth.textFieldWidth
Layout.maximumWidth: itemWidth.textFieldWidth
placeholderText: qsTr("Harm number")
text: model.numberHarm
ToolTip.timeout: 2000
ToolTip.visible: pressed
ToolTip.text: qsTr("Harm number must be in line with given mask!")
//"Die Schadensnummer muss der vorgegebenen Maske entsprechen!"
background: Rectangle {
border.color: numberHarm.activeFocus ? "#6f1a32" : "lightgrey"
radius: 5
border.width: 2
}
} // numberHarm
} // rowNumberHarm
RowLayout {
id: rowPolicyOwner
visible: true
//Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
spacing: 12
Nwx.Label {
id: labelPolicyowner
Layout.minimumWidth: 100
Layout.preferredWidth: itemWidth.labelWidth
text: qsTr("Name")
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
}
Nwx.TextField {
id: namePolicyowner
//Layout.preferredWidth: 200
//Layout.maximumWidth: 400
Layout.preferredWidth: itemWidth.textFieldWidth
Layout.maximumWidth: itemWidth.textFieldWidth
//width: rowPoliciesowner - 100
//Layout.fillWidth: true
text: model.namePolicyowner
//width: 300
placeholderText: qsTr("Name of the given policies owner")
background: Rectangle {
radius: 5
border.color: namePolicyowner.activeFocus ? "#6f1a32" : "lightgrey"
border.width: 2
}
} // namePolicyowner
} // rowPolicyOwner
RowLayout {
id: rowPolicyholder
Layout.fillWidth: true
visible: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
spacing: 12
Nwx.Label {
id: labelPolicyholder
Layout.minimumWidth: 100
//Layout.preferredWidth: 140
Layout.preferredWidth: itemWidth.labelWidth
text: qsTr("Policy number")
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
}
Nwx.TextField {
id: numberPolicyholder
//Layout.preferredWidth: 200
//Layout.maximumWidth: 300
Layout.preferredWidth: itemWidth.textFieldWidth
Layout.maximumWidth: itemWidth.textFieldWidth
//width: rowPolicyholder - 100
//Layout.fillWidth: true
//text: qsTr("Nummer der Police")
text: model.numberPolicyholder
//width: 300
placeholderText: qsTr("Number of the given policy")
inputMask: "0000-00-000-0000"
background: Rectangle {
radius: 5
border.color: numberPolicyholder.activeFocus ? "#6f1a32" : "lightgrey"
border.width: 2
}
} // numberPolicyholder
} // rowPolicyholder
} // columnBaseData
} // groupBoxKeyData
Pane {
id: groupBoxSelectionData
//title: qsTr("Key data")
implicitWidth: Math.max(switchSecurity.width, comboLawSpec.width) + comboLawSpec.rightPadding + leftPadding
//anchors.right: parent.right
//anchors.fill: parent
//Layout.fillWidth: true
ColumnLayout {
id: columnSelectionData
//width: parent.width
anchors.topMargin: 12
spacing: 4
Switch {
id: switchSecurity
text: qsTr("Security")
//Layout.minimumWidth: 150
//Layout.preferredWidth: 150
Layout.fillWidth: true
anchors.right: parent.right
checked: model.switchSecuritiy ? true : false
indicator: Rectangle {
implicitWidth: 32
implicitHeight: 20
//x: switchSecurity.leftPadding
x: switchSecurity.width - width - switchSecurity.rightPadding
y: parent.height / 2 - height / 2
radius: 13
color: switchSecurity.checked ? "#6f1a32" : "#ffffff"
border.color: switchSecurity.checked ? "#6f1a32" : "#cccccc"
Rectangle {
x: switchSecurity.checked ? parent.width - width : 0
width: 20
height: 20
radius: 13
color: switchSecurity.down ? "#6f1a32" : "#ffffff"
border.color: switchSecurity.checked ? (switchSecurity.down ? "#6f1a32" : "lightgrey") : "#999999"
}
}
contentItem: Text {
text: switchSecurity.text
font: switchSecurity.font
opacity: enabled ? 1.0 : 0.3
color: switchSecurity.down ? "#6f1a32" : "black"
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
//leftPadding: switchSecurity.indicator.width + switchSecurity.spacing
rightPadding: switchSecurity.indicator.width + switchSecurity.spacing
}
} // switchSecurity
Switch {
id: switchSB
text: qsTr("SB")
//Layout.minimumWidth: 150
//Layout.preferredWidth: 150
Layout.fillWidth: true
anchors.right: parent.right
checked: model.switchSB ? true : false
contentItem: Text {
text: switchSB.text
font: switchSB.font
opacity: enabled ? 1.0 : 0.3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
//leftPadding: switchSB.indicator.width + switchSB.spacing
rightPadding: switchSB.indicator.width + switchSB.spacing
}
indicator: Rectangle {
implicitWidth: 32
implicitHeight: 20
//x: switchSB.leftPadding
x: switchSB.width - width - switchSB.rightPadding
y: parent.height / 2 - height / 2
radius: 13
color: switchSB.checked ? "#6f1a32" : "#ffffff"
border.color: switchSB.checked ? "#6f1a32" : "#cccccc"
Rectangle {
x: switchSB.checked ? parent.width - width : 0
width: 20
height: 20
radius: 13
color: switchSB.down ? "#cccccc" : "#ffffff"
border.color: switchSB.checked ? (switchSB.down ? "#17a81a" : "#6f1a32") : "#999999"
}
}
} // switchSB
ComboBox {
id: comboLawSpec
//textRole: qsTr("field of law")
//Layout.fillWidth: true
Layout.minimumWidth: 100
Layout.preferredWidth: 180
anchors.right: parent.right
rightPadding: 8
leftPadding: 8
model: ["Arbeitsrecht", "Baurecht", "Gesellschaftsrecht", "Verkehrsrecht", "Versicherungsrecht"]
delegate: ItemDelegate {
width: comboLawSpec.width
contentItem: Text {
text: modelData
color: "black"
font: comboLawSpec.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: comboLawSpec.highlightedIndex === index
}
indicator: Canvas {
id: canvas
x: comboLawSpec.width - width - comboLawSpec.rightPadding
y: comboLawSpec.topPadding + (comboLawSpec.availableHeight - height) / 2
width: 12
height: 8
contextType: "2d"
Connections {
target: comboLawSpec
onPressedChanged: canvas.requestPaint()
}
onPaint: {
context.reset();
context.moveTo(0, 0);
context.lineTo(width, 0);
context.lineTo(width / 2, height);
context.closePath();
context.fillStyle = comboLawSpec.pressed ? "#6f1a32" : "grey";
context.fill();
}
}
contentItem: Text {
leftPadding: 0
rightPadding: comboLawSpec.indicator.width + comboLawSpec.spacing
text: comboLawSpec.displayText
font: comboLawSpec.font
color: comboLawSpec.pressed ? "#6f1a32" : "black"
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
border.color: comboLawSpec.pressed ? "#6f1a32" : "lightgrey"
radius: 5
border.width: 1
}
popup: Popup {
y: comboLawSpec.height - 1
width: comboLawSpec.width
font.pixelSize: 8
implicitHeight: contentItem.implicitHeight
padding: 5
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: comboLawSpec.popup.visible ? comboLawSpec.delegateModel : null
currentIndex: comboLawSpec.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
border.color: "lightgrey"
radius: 5
}
}
} // comboLawSpec
} // groupBoxSelectionData
} // groupBoxSelectonData
} // gridBoxBaseData
} // groupBoxBaseData
GroupBox {
id: groupBoxHarmData
title: qsTr("Data facts")
anchors.top: groupBoxBaseData.bottom
anchors.topMargin: 18
width: parent.width
Layout.fillWidth: true
ColumnLayout {
id: columnHarmData
width: parent.width
anchors.topMargin: 12
Layout.fillWidth: true
spacing: 16
RowLayout {
id: rowNumberHarmReport
//width: pane.availableWidth - 2 * rowNumberHarmReport.spacing
//width: pane.availableWidth - rowNumberHarmReport.spacing
//width: 450
//height: rowNumberHarmReport.implicitHeight
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
visible: true
spacing: 12
Nwx.Label {
id: labelNumberHarmReport
Layout.minimumWidth: 100
//Layout.preferredWidth: 140
Layout.preferredWidth: itemWidth.labelWidth
text: qsTr("Harm report")
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
anchors.top: parent.top
anchors.topMargin: 16
} // Label
Flickable {
id: flickableNumberHarmReport
//clip: true
flickableDirection: Flickable.VerticalFlick
Layout.fillWidth: true
height: 120
//anchors.centerIn: parent
//anchors.fill: parent
//focus: true
Keys.onUpPressed: scrollBarNumberHarmReport.decrease()
Keys.onDownPressed: scrollBarNumberHarmReport.increase()
// place a TextArea inside the flickable
TextArea.flickable: TextArea {
id: numberHarmReport
textMargin: 8
//textFormat: TextEdit.RichText
//width: pane.availableWidth - 2 * rowNumberHarmReport.spacing - labelNumberHarmReport.width
//text: qsTr("Initial Text 1st line\n2nd line\n\n\Last line.")
text: model.harmReport
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
//Layout.preferredWidth: rowNumberHarmReport.availableWidth - 2 * rowNumberHarmReport.spacing - labelNumberHarmReport.width
//width: rowPolicyholder - 100
//Layout.preferredWidth: rowNumberHarmReport - 100
Layout.preferredWidth: 300
Layout.maximumHeight: 400
renderType: TextArea.NativeRendering
wrapMode: TextArea.WordWrap
background: Rectangle {
border.color: numberHarmReport.activeFocus ? "#6f1a32" : "lightgrey"
radius: 5
border.width: 2
//implicitWidth: 100
//implicitHeight: 24
} // TextArea
ToolTip {
id: toolTipNumberHarmReport
text: qsTr("Please record all infomation and curcumstances that are relevant to the harm.")
//visible: true
delay: 1500
timeout: 5000
visible: numberHarmReport.hovered
contentItem: Text {
text: toolTipNumberHarmReport.text
font: toolTipNumberHarmReport.font
color: "#6f1a32"
}
background: Rectangle {
border.color: "lightgrey"
}
}
} // numberHarmReport
ScrollIndicator.vertical: ScrollIndicator {
id: scrollIndicatorNumberHarmReport
padding: 5
leftPadding: 5
topPadding: 5
}
ScrollBar.vertical: ScrollBar {
id: scrollBarNumberHarmReport
policy: ScrollBar.AsNeeded
//interactive: true
active: hovered || pressed
//parent: numberHarmReport
//anchors.right: parent.right
//policy: ScrollBar.AlwaysOn
//x: scrollViewNumberHarmReport.mirrored ? 0 : scrollViewNumberHarmReport.width - width
//y: scrollViewNumberHarmReport.topPadding
//height: scrollViewNumberHarmReport.availableHeight
//active: scrollViewNumberHarmReport.ScrollBar.vertical.active
background: Rectangle {
radius: 5
//implicitWidth: 100
//implicitHeight: 24
border.color: "grey"
color: "lightgrey"
border.width: 2
}
} //scrollBarNumberHarmReport
// Only show the scrollbars when the flickableNumberHarmReport is moving.
states: State {
name: "ShowBars"
when: flickableNumberHarmReport.movingVertically
// PropertyChanges { target: verticalScrollBar; opacity: 1 }
}
transitions: Transition {
NumberAnimation { properties: "opacity"; duration: 400 }
}
//height: pane.availableHeight * 3 / 2
//width: Math.max(pane.availableWidth - labelNumberHarmReport.width - rowNumberHarmReport.spacing, Math.min(implicitWidth))
//width: Math.max(pane.availableWidth * 8 / 10, Math.min(pane.availableWidth - rowNumberHarmReport.spacing - labelNumberHarmReport.Width))
//width: implicitwidth
} // flickable
} // rowNumberHarmReport
RowLayout {
id: rowRightsCouncil
//width: pane.availableWidth - 2 * rowNumberHarmReport.spacing
//width: pane.availableWidth - rowNumberHarmReport.spacing
//width: 450
//height: rowNumberHarmReport.implicitHeight
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
visible: true
spacing: 12
Nwx.Label {
id: labelRightsCouncil
Layout.minimumWidth: 100
//Layout.preferredWidth: 140
Layout.preferredWidth: itemWidth.labelWidth
text: qsTr("Rights Council")
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
anchors.top: parent.top
anchors.topMargin: 16
} // labelRightsCouncil
Flickable {
id: flickableRightsCouncil
//clip: true
flickableDirection: Flickable.VerticalFlick
Layout.fillWidth: true
height: 120
//anchors.centerIn: parent
//anchors.fill: parent
//focus: true
Keys.onUpPressed: scrollBarRightsCouncil.decrease()
Keys.onDownPressed: scrollBarRightsCouncil.increase()
// place a TextArea inside the flickable
TextArea.flickable: TextArea {
id: rightsCouncil
textMargin: 8
//textFormat: TextEdit.RichText
//text: qsTr("Initial Text 1st line\n2nd line\n\n\Last line.")
text: model.rightsCouncil
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
//Layout.preferredWidth: rowRightsCouncil.availableWidth - 2 * rowRightsCouncil.spacing - labelRightsCouncil.width
//width: rowPolicyholder - 100
//Layout.preferredWidth: rowRightsCouncil - 100
Layout.preferredHeight: 250
Layout.maximumHeight: 400
renderType: TextArea.NativeRendering
wrapMode: TextArea.WordWrap
background: Rectangle {
border.color: rightsCouncil.activeFocus ? "#6f1a32" : "lightgrey"
radius: 5
border.width: 2
//implicitWidth: 100
//implicitHeight: 24
}
ToolTip {
id: toolTipRightsCouncil
text: qsTr("Please record the given rights council.")
//visible: true
delay: 1500
timeout: 5000
visible: rightsCouncil.hovered
contentItem: Text {
text: toolTipRightsCouncil.text
font: toolTipRightsCouncil.font
color: "#6f1a32"
}
background: Rectangle {
border.color: "lightgrey"
}
} // toolTipRightsCouncil
} // rightsCouncil
ScrollIndicator.vertical: ScrollIndicator {
id: scrollIndicatorRightsCouncil
padding: 5
leftPadding: 5
topPadding: 5
}
ScrollBar.vertical: ScrollBar {
id: scrollBarRightsCouncil
policy: ScrollBar.AsNeeded
//interactive: true
active: hovered || pressed
//parent: numberHarmReport
//anchors.right: parent.right
//policy: ScrollBar.AlwaysOn
//x: scrollViewRightsCouncil.mirrored ? 0 : scrollViewRightsCouncil.width - width
//y: scrollViewRightsCouncil.topPadding
//height: scrollViewRightsCouncil.availableHeight
//active: scrollViewRightsCouncil.ScrollBar.vertical.active
background: Rectangle {
radius: 5
//implicitWidth: 100
//implicitHeight: 24
border.color: "grey"
color: "lightgrey"
border.width: 2
}
} // scrollBarRightsCouncil
// Only show the scrollbars when the flickableRightsCouncil is moving.
states: State {
name: "ShowBars"
when: flickableRightsCouncil.movingVertically
// PropertyChanges { target: verticalScrollBar; opacity: 1 }
}
transitions: Transition {
NumberAnimation { properties: "opacity"; duration: 400 }
}
//height: pane.availableHeight * 3 / 2
//width: Math.max(pane.availableWidth - labelRightsCouncil.width - rowRightsCouncil.spacing, Math.min(implicitWidth))
//width: Math.max(pane.availableWidth * 8 / 10, Math.min(pane.availableWidth - rowRightsCouncil.spacing - labelRightsCouncil.Width))
//width: implicitwidth
} // flickable
} // rowRightsCouncil
} // columHarmData
} // groupBoxHarmData
GroupBox {
id: groupBoxMgmtData
title: qsTr("Management data")
anchors.top: groupBoxHarmData.bottom
width: parent.width
anchors.topMargin: 18
Layout.fillWidth: true
ColumnLayout {
id: columnAdminData
width: parent.width
anchors.topMargin: 12
spacing: 16
GroupBox {
id: groupBoxDone
Layout.fillWidth: true
RowLayout {
id: rowDone
Layout.fillWidth: true
//Layout.preferredWidth: 450
ButtonGroup {
id: buttonGroupCME
//buttons: rowRadioCME
}
RowLayout {
id: rowRadioCME
spacing: 12
Nwx.Label {
id: labelDone
Layout.minimumWidth: 100
Layout.preferredWidth: 120
text: qsTr("Done")
//horizontalAlignment: Qt.AlignHLeft
//verticalAlignment: Qt.AlignVCenter
}
RadioButton {
id: buttonDoneYes
ButtonGroup.group: buttonGroupCME
text: qsTr("Yes")
checked: model.switchDone ? true : false
//signal qmlSignal(string msg)
onClicked: advoTrackerClass.buttonDoneYes(text)
//onClicked: qmSignal(text)
}
RadioButton {
id: buttonDoneNo
ButtonGroup.group: buttonGroupCME
text: qsTr("No")
}
RadioButton {
id: buttonDoneCME
ButtonGroup.group: buttonGroupCME
text: qsTr("CME")
checked: model.switchCME ? true : false
//signal qmlSignal(string msg)
//onClicked: qmlSignal(text)
onClicked: {
advoTrackerClass.buttonDoneCME(text)
doneCME: true
}
} // buttonCME
Nwx.TextField {
id: phoneCME
opacity: buttonDoneCME ? 1.0 : 0
Layout.preferredWidth: 250
Layout.maximumWidth: 300
//Layout.preferredWidth: itemWidth.textFieldWidth
//Layout.maximumWidth: itemWidth.textFieldWidth
placeholderText: qsTr("Phone number policieowner")
background: Rectangle {
radius: 5
border.color: buttonDoneCME.activeFocus ? "#6f1a32" : "lightgrey"
border.width: 2
}
} // phoneCME
} // rowRodioCME
/*
ButtonGroup {
id: buttonGroup
}
ListView {
model: [qsTr("Yes"), qsTr("No"), qsTr("CME")]
orientation: ListView.Horizontal
Layout.preferredWidth: 200
delegate: RadioDelegate {
text: modelData
anchors.top: groupBoxDone.top
//checked: index == 0
//ButtonGroup.group: buttonGroup
}
}*/
} // rowDone
} // GroupBoxDone
GroupBox {
id: groupBoxCME
Layout.fillWidth: true
RowLayout {
id: rowCME
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Nwx.Label {
id: labelCME
Layout.minimumWidth: 100
Layout.preferredWidth: 120
text: qsTr("CME submitted")
horizontalAlignment: Qt.AlignHLeft
verticalAlignment: Qt.AlignTop
}
Row {
RadioButton { text: qsTr("Yes") }
RadioButton { text: qsTr("No") }
}
} // rowCME
} // groupBoxCME
RowLayout {
id: rowComboDone
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
spacing: 12
Nwx.Label {
id: labelcomboDone
Layout.minimumWidth: 100
Layout.preferredWidth: 120
text: qsTr("CME")
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
}
ComboBox {
id: comboDone
//textRole: qsTr("done")
Layout.minimumWidth: 100
Layout.preferredWidth: 180
rightPadding: 8
leftPadding: 8
model: [qsTr("Yes"), qsTr("No"), qsTr("CME")]
delegate: ItemDelegate {
width: comboDone.width
contentItem: Text {
text: modelData
color: "black"
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: comboDone.highlightedIndex === index
}
indicator: Canvas {
id: canvasComboDone
x: comboDone.width - width - comboDone.rightPadding
y: comboDone.topPadding + (comboDone.availableHeight - height) / 2
width: 12
height: 8
contextType: "2d"
Connections {
target: comboDone
onPressedChanged: canvas.requestPaint()
}
onPaint: {
context.reset();
context.moveTo(0, 0);
context.lineTo(width, 0);
context.lineTo(width / 2, height);
context.closePath();
context.fillStyle = comboDone.pressed ? "#6f1a32" : "grey";
context.fill();
}
}
contentItem: Text {
leftPadding: 0
rightPadding: comboDone.indicator.width + comboDone.spacing
text: comboDone.displayText
//font: lawSpec.font
color: comboDone.pressed ? "#6f1a32" : "black"
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
border.color: comboDone.pressed ? "#6f1a32" : "lightgrey"
radius: 5
border.width: 1
}
popup: Popup {
y: comboDone.height - 1
width: comboDone.width
//font.pixelSize: 8
implicitHeight: contentItem.implicitHeight
padding: 5
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: comboDone.popup.visible ? comboDone.delegateModel : null
currentIndex: comboDone.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
border.color: "lightgrey"
radius: 5
}
}
} // comboDone
} // rowDone
RowLayout {
id: rowOpitons
CheckBox {
id: checkBoxCME
text: qsTr("Central mandate editing")
checked: model.switchCME ? true : false
//mirrored: true
}
CheckBox {
text: qsTr("Surcharge")
//mirrored: true
checked: model.switchSurcharge ? true : false
}
}
/*
CheckBox {
id: control
text: qsTr("CheckBox")
checked: false
indicator: Rectangle {
implicitWidth: 26
implicitHeight: 26
x: control.width - width - control.rightPadding
//x: control.leftPadding
y: parent.height / 2 - height / 2
radius: 3
border.color: control.down ? "#6f1a32" : "black"
Rectangle {
width: 14
height: 14
x: 6
y: 6
radius: 2
color: control.down ? "#6f1a32" : "#6f1a32"
visible: control.checked
}
}
contentItem: Text {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
color: control.down ? "#6f1a32" : "black"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
//leftPadding: control.indicator.width + control.spacing
rightPadding: control.indicator.width + control.spacing
ToolTip.text: qsTr("Tooltip text.")
}
}*/
} //columnAdminData
} // groupBoxMgmtData
} // paneNumberHarmData
} // listNumberHarmData
} // paneNumberHarmAdmin

View File

@@ -0,0 +1,341 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
/**
* @brief Add relevant NumberHarm informations to db
* @param numberHarm - Schadensnummer
* @param numberPolicyholder - Policennummer des Versicherungsnehmers
* @param numberCallback - Rückrufnummer
* @param dateCallback - Rückrufdatum
* @param dateRecording - Schadensdatum
* @param userId - integer representation of username
* @param dateChanged - Änderungsdatum des Datensatzes
* @param userIdChanged - Änderung durch UserId
*
* @return QSqlError
*/
Page {
id: pagePolicy
property bool doneCME: false
Action {
id: actionPolicyBase
text: Nwx.MdiFont.Icon.helpCircleOutline + " " + qsTr("&Base")
shortcut: "Ctrl+B"
//onTriggered: stackViewMain.push("qrc:/pages/PolicyPageBase.qml", { numberHarm: filterModelUser.get(index).numberHarm } )
//onTriggered: stackViewMain.push("qrc:/pages/PolicyPageBase.qml", { numberHarm: "47114711" } )
//onTriggered: stackViewMain.push("qrc:/pages/PolicyPageBase.qml")
onTriggered: panePolicyBase.source = "PanePolicyBase.qml"
}
Action {
id: actionPolicyHistory
text: Nwx.MdiFont.Icon.helpCircleOutline + " " + qsTr("&History")
shortcut: "Ctrl+H"
//onTriggered: stackViewMain.push("qrc:/PolicyPageHistory.qml", { numberHarm: filterModelUser.get(index).numberHarm } )
//onTriggered: stackViewMain.push("qrc:/pages/PolicyPageHistory.qml", { numberHarm: "47114711" } )
onTriggered: panePolicyHistory.source = "PanePolicyHistory.qml"
}
header: TabBar {
id: tabBar
currentIndex: swipePolicy.currentIndex
//tabView: tabframe
width: parent.width
position: TabBar.Header
contentWidth: 150
padding: 4
//font.pointSize: 12
wheelEnabled: false
spacing: 8
antialiasing: true
background: Rectangle {
//color: tabbar.down ? "#d6d6d6": "#f6f6f6"
border.width: 1
radius: 4
}
TabButton {
text: qsTr("Base")
action: actionPolicyBase
}
//TabButton {
// text: qsTr("Extended")
// action: actionPolicyExtended
//}
TabButton {
text: qsTr("History")
action: actionPolicyHistory
}
} // tabBar
SwipeView {
id: swipePolicy
anchors.fill: parent
//currentIndex: tabBar.currentIndex
//currentIndex: 1
//background: Rectangle {
// color: "#eeeeee"
//}
Dialog {
id: searchDialog
modal: true
focus: true
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: {
settings.style = styleBox.displayText
// start sql-search
searchDialog.close()
}
onRejected: {
styleBox.currentIndex = styleBox.styleIndex
searchDialog.close()
}
contentItem: ColumnLayout {
id: columnSearch
spacing: 20
RowLayout {
spacing: 10
Nwx.Label {
text: qsTr("Start searching?")
}
} // rowLayout
} // columnSearch
} // searchDialog
Loader {
// Declaration of a Loader. It will be activated later.
id: loaderPolicyBase
}
signal handlerLoader(string name, int index)
Loader {
// Declaration of a Loader. It will be activated later.
id: loaderPolicyHistory
}
Loader {
id: loaderPolicyBase
source: PanePolicyBase
}
Connection {
target: loaderPolicyBase
onHandlerLoader: {
loaderPolicyBase.source=name;
if (index === 2) {
window.source = "NewWindowx.qml";
}
}
//PanePolicyBase {
// id: policyBase
//}
//PanePolicyHistory {
// id: policyHistory
//}
/*
Item {
id: itemPolicyBase
anchors.fill: parent
Loader {
id: loaderPolicyBase
anchors.fill: parent
source: PanePolicyBase
}
MouseArea {
anchors.fill: parent
onClicked: panePolicyBase.source = "PanePolicyBase.qml"
}
}
Item {
id: itemPolicyHistory
//anchors.fill: parent
Loader {
id: panePolicyHistory
source: panePolicyHistory
}
MouseArea {
//anchors.fill: parent
onClicked: panePolicyHistory.source = "PanePolicyHistory.qml"
}
}
*/
/*
Repeater {
model: 5
Loader {
id: loaderRepeater
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
sourceComponent: Label {
text: index + ": " + qsTr("Titel")
color: "black"
verticalAlignment: Label.AlignVCenter
horizontalAlignment: Label.AlignHCenter
padding: 12
height: parent.height / 2
width: parent.height / 2
//anchors: parent.center
background: Rectangle {
color: index === 1 ? Qt.darker("lightsteelblue", 1.1) : "lightsteelblue"
}
Component.onCompleted: {
loaderRepeater.setSource("PanePolicyBase.qml")
console.log("created:", index)
}
Component.onDestruction: console.log("destroyed:", index)
}
}
} // Repeater
/*
/*
ListView {
id: listSwipe
//anchors.fill: parent
currentIndex: 1
model: ListModel {
id: modelSwipeDelegate
ListElement { loader: "PolicyPageBasic.qml"; title: qsTr("Basic") }
ListElement { loader: "PolicyPageHistory.qml"; title: qsTr("History") }
} // modelSwipeDelegate
delegate: SwipeDelegate {
id: swipeDelegate
text: model.title + " - " + model.loader
width: parent.width
ListView.onRemove: SequentialAnimation {
id: swipeAnimationRemove
PropertyAction {
target: swipeDelegate
property: "ListView.delayRemove"
value: true
}
NumberAnimation {
target: swipeDelegate
property: "height"
to: 0
easing.type: Easing.InOutQuad
}
PropertyAction {
target: swipeDelegate
property: "ListView.delayRemove"
value: false
}
} // swipeAnimationRomove
swipe.right: Label {
id: deleteLabel
text: qsTr("Delete")
color: "white"
verticalAlignment: Label.AlignVCenter
padding: 12
height: parent.height
anchors.right: parent.right
SwipeDelegate.onClicked: listSwipe.model.remove(index)
background: Rectangle {
color: deleteLabel.SwipeDelegate.pressed ? Qt.darker("lightsteelblue", 1.1) : "lightsteelblue"
}
} // deleteLabel
} // swipeDelegate
Loader {
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
sourceComponent: Label {
text: modelSwipeDelegate.model.title
Component.onCompleted: console.log("created:", index)
Component.onDestruction: console.log("destroyed:", index)
}
} // loader
} // listSwipe
*/
} // swipePolicy
PageIndicator {
id: indicatorPolicy
count: swipePolicy.count
currentIndex: swipePolicy.currentIndex
anchors.bottom: swipePolicy.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
/*
Flickable {
id: flickablePolicy
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
//contentHeight: panePolicy.implicitHeight
flickableDirection: Flickable.AutoFlickIfNeeded
ScrollIndicator.vertical: ScrollIndicator { }
//Item {
// id: panePolicyBase
//}
//Item {
// id: panePolicyHistory
//}
Loader {
id: panePolicyBase
sourceComponent: panePolicyBase
//source: PanePolicyBase.qml
//asynchronous: true
//visible: status == Loader.Ready
}
Loader {
id: panePolicyHistory
sourceComponent: panePolicyHistory
//source: PanePolicyHistory.qml
}
} // flickablePolicy
*/
} // pagePolicy

View File

@@ -0,0 +1,94 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.6
import QtQuick.Controls 2.1
Rectangle {
id: rectanglesTab
width: parent.width
height: parent.height
color: "black"
signal contentsClicked(string rectColor)
GridLayout {
width: parent.width
height: parent.height
columnSpacing: 5
rowSpacing: 5
columns: 1
Rectangle {
width: parent.width
height: 120
color: "blue"
MouseArea{
anchors.fill: parent
onClicked: {
contentsClicked( "blue" )
}
}
}
Rectangle {
width: parent.width
height: 120
color: "red"
MouseArea{
anchors.fill: parent
onClicked: {
contentsClicked( "red" )
}
}
}
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.3
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
Pane {
property alias text: textSearch.displayText
leftPadding: 0
topPadding: 0
bottomPadding: 0
rightPadding: 0
ToolBar {
//height: 56
Material.foreground: "white"
//Material.background: "grey"
Layout.fillWidth: true
anchors.fill: parent
RowLayout {
id: rowLayout
//anchors.fill: parent
Layout.fillWidth: true
spacing: 8
anchors.margins: 4
anchors.right: parent.right
anchors.fill: parent
/*
Label {
id: labelMenu
anchors.left: parent.left
anchors.leftMargin: rowLayout.spacing
text: Nwx.MdiFont.Icon.menu
font.pixelSize: 32
}
*/
Label {
id: labelSearch
anchors.right: textSearch.left
anchors.rightMargin: rowLayout.spacing
text: Nwx.MdiFont.Icon.magnify
font.pixelSize: 28
}
Nwx.TextField {
id: textSearch
anchors.right: parent.right
anchors.rightMargin: rowLayout.spacing
placeholderText: qsTr("Search ...")
}
}
}
}

View File

@@ -0,0 +1,161 @@
/*
* 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 QtQuick.Controls.Material 2.3 // Qt 5.10
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
import SortFilterProxyModel 0.2
Pane {
id: paneSqlTestPage
Layout.fillWidth: true
//anchors: fill
ListModel {
id: modelPerson
ListElement {
firstName: "Dirk"
lastName: "Hiedemann"
favorite: false
}
ListElement {
firstName: "Helmut"
lastName: "Schlömer"
favorite: true
}
ListElement {
firstName: "Katarina"
lastName: "Muth"
favorite: false
}
ListElement {
firstName: "Ralf"
lastName: "Zerres"
favorite: true
}
ListElement {
firstName: "Jochen"
lastName: "Plank"
favorite: true
}
ListElement {
firstName: "Peter"
lastName: "Lafferenz"
favorite: false
}
ListElement {
firstName: "Frank"
lastName: "Jakoby"
favorite: false
}
} // modelPerson
// simple filter
SortFilterProxyModel {
id: filterModelPerson
sourceModel: modelPerson
filters: RegExpFilter {
roleName: "lastName"
pattern: textSearch.text
caseSensitivity: Qt.CaseInsensitive
}
sorters: StringSorter { roleName: "firstName" }
}
// multiple filter / sorters
SortFilterProxyModel {
id: filterModelPersonComplex
sourceModel: modelPerson
filters: [
ValueFilter {
//enabled: onlyShowFavoritesCheckbox.checked
roleName: "favorite"
value: true
},
AnyOf {
RegExpFilter {
roleName: "lastName"
pattern: textSearch.text
caseSensitivity: Qt.CaseInsensitive
}
RegExpFilter {
roleName: "firstName"
pattern: textSearch.text
caseSensitivity: Qt.CaseInsensitive
}
}
]
sorters: [
RoleSorter { roleName: "favorite"; sortOrder: Qt.DescendingOrder },
StringSorter { roleName: "firstName" },
StringSorter { roleName: "lastName" }
]
} // filterModelPersonComplex
RowLayout {
id: rowHeader
//anchors.fill: parent
Layout.fillWidth: true
//Material.elevation: 6
height: 14
spacing: 8
Nwx.Button {
text: Nwx.MdiFont.Icon.pencil + " " + qsTr("Add an item")
onPressed: {
modelPerson.append({
"firstName": "Mustafa",
"lastName": "Hammadi",
"favorite": true
})
}
}
Label {
id: labelSearch
anchors.right: textSearch.left
anchors.rightMargin: rowLayout.spacing
text: Nwx.MdiFont.Icon.magnify
}
TextField {
id: textSearch
anchors { top: parent.top; right: parent.right }
anchors.rightMargin: rowLayout.spacing
height: implicitHeight
placeholderText: qsTr("Search ...")
}
}
ListView {
anchors { top: rowHeader.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }
anchors.topMargin: 25
model: filterModelPersonComplex
//delegate: Text { text: model.firstName + " " + model.lastName}
delegate: Text { text: model.firstName + " " + model.lastName; }
} // ListView
}

View File

@@ -0,0 +1,53 @@
/*
* 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.9
//import QtQuick.Controls 2.1
//import QtQuick.Layouts 1.3
ScrollablePage {
id: sqlViewPage
//width: 6400
//height: 500
MouseArea {
anchors.fill: parent
ListView {
id: sqlListView
x: 5
y: 25
width: parent.width
height: 300
delegate: UserModelPage {}
model: userModel
highlight: highlightComponent
focus: true
}
Component {
id: highlightComponent
Text {
width: ListView.view.width
color: surfaceColor
}
}
}
}

View File

@@ -0,0 +1,149 @@
/*
* 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
// AdvoTracker Module
import de.networkx.AdvoTracker 1.0 as Nwx
Pane {
id: pane
width: 1024
height: 768
visible: true
ListView {
id: listView
width: 400
height: 800
model: ListModel {
id: projectModel
ListElement { projectID: 11; manager: 'Papa'; sponsor: 'Jana' }
ListElement { projectID: 12; manager: 'YOU'; sponsor: 'dad' }
ListElement { projectID: 13; manager: 'HE'; sponsor: 'auntie' }
ListElement { projectID: 99; manager: 'Cara'; sponsor: 'Paul' }
}
delegate: ItemDelegate {
id: projectSwipeDelegate
width: parent.width
spacing: 10
// height: <--- provide a height, if the contentItem does not provide it.
//Layout.preferredHeight: 70
//height: 70
contentItem: Row {
id: rowProjectDelegate
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
Layout.preferredHeight: 60
height: 80
Column {
id: column
width: parent.width
//height: 80
spacing: 8
Row {
id: rowHeader
spacing: 16
height: 12
Rectangle {
id: rectangle2
Layout.minimumWidth: 200
Layout.preferredWidth: 250
height: 10
color: "blue"
}
Rectangle {
id: rectangle1
Layout.minimumWidth: 100
Layout.preferredWidth: 120
height: 10
color: "red"
}
} // rowHeader
Row {
id: rowDelegate
spacing: 16
Label {
id: labelNumberHarm
Layout.minimumWidth: 100
Layout.preferredWidth: 120
text: qsTr("Harm number")
//"Schadensnummer"
horizontalAlignment: Qt.AlignHRight
verticalAlignment: Qt.AlignTop
}
Nwx.TextField {
id: projectID_text
Layout.preferredWidth: 200
Layout.maximumWidth: 250
height: 30
//Layout.preferredHeight: 50
text: projectID
font.pointSize: 12
font.weight: Font.Black
color: "black"
}
} // rowDelegate
Label {
id: manager_text
text: 'Manager: ' + manager + " Sponsor: " + sponsor
font.pointSize: 12
//font.weight: Font.Thin
height: 15
color: "green"
}
} // column
} // rowProjectDelegate
onClicked: {
console.log("index:", index, "; projectID:", projectModel.get(index).projectID)
}
/*
swipe.right: Label {
id: deleteLabel
text: qsTr("Delete")
color: "white"
verticalAlignment: Label.AlignVCenter
padding: 12
height: parent.height
anchors.right: parent.right
SwipeDelegate.onClicked: projectListView.model.remove(index)
background: Rectangle {
color: deleteLabel.SwipeDelegate.pressed ? Qt.darker("tomato", 1.1) : "tomato"
}
}
*/
} // projectSwipeDelegate
} // listView
} // pane

View File

@@ -0,0 +1,266 @@
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 SortFilterProxyModel 0.2
//Page {
Pane {
id: pane
anchors.fill: parent
anchors.margins: 12
Component {
id: c0
//id: swipeDelegateHistory
Nwx.IconButton {
text: "Index:" + model.index
width: parent.width
}
} // swipeDelegateBase
Component {
id: c1
//id: swipeDelegateBase
Nwx.IconButton {
text: "Index:" + index
width: parent.width
}
} // swipeDelegateHistory
SwipeView {
id: swipeView
anchors.fill: parent
Layout.fillWidth: true
Repeater {
model: 3
//property var delegateComponent: {
// "delegateComponent0": swipeDelegateBase,
// "delegateComponent1": swipeDelegateHistory
//} // delegateComponent
Loader {
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem // <==
// sourceComponent: delegateComponent[index]
sourceComponent: Item {
width: parent.width
Loader { source: "PaneNumberHarmBase.qml" }
Component.onCompleted: console.log("created:", index)
Component.onDestruction: console.log("destroyed:", index)
}
/* Text {
text: index
} */
//} // Loader
} // Loader
} // Repeater
} // swipeView
PageIndicator {
id: indicatorNumber
count: swipeView.count
currentIndex: swipeView.currentIndex
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
} // Pane
//} // Page
/*
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
Pane {
padding: 0
property var delegateComponentMap: {
"ItemDelegate": itemDelegateComponent,
"SwipeDelegate": swipeDelegateComponent,
"CheckDelegate": checkDelegateComponent,
"RadioDelegate": radioDelegateComponent,
"SwitchDelegate": switchDelegateComponent
} // delegate ComponentMap
Component {
id: itemDelegateComponent
ItemDelegate {
text: labelText
width: parent.width
}
} // itemDelegateComponent
Component {
id: swipeRemoveComponent
Label {
font.pixelSize: swipeDelegate.font.pixelSize
text: qsTr("Remove")
color: "white"
verticalAlignment: Label.AlignVCenter
padding: 12
anchors.centerIn: parent
background: Rectangle {
color: SwipeDelegate.pressed ? "#444" : "lightsteelblue"
width: parent.width
height: parent.height
clip: true
}
SwipeDelegate.onClicked: view.model.remove(ourIndex)
}
} // swipeDelegateRemove
Component {
id: swipeDelegateComponent
SwipeDelegate {
id: swipeDelegate
text: labelText + " " + ourIndex
width: parent.width
Loader {
id: swipeRemoveComponet
sourceComponent: swipeRemoveComponent
}
swipe.left: swipeRemoveComponent
swipe.right: swipeRemoveComponent
}
} // swipeDelegateComponent
Component {
id: checkDelegateComponent
CheckDelegate {
text: labelText + " " + ourIndex
width: parent.width
}
} // checkDelegateComponent
ButtonGroup {
id: radioButtonGroup
} // radioButtonGroup
Component {
id: radioDelegateComponent
RadioDelegate {
text: labelText
ButtonGroup.group: radioButtonGroup
}
} // radioDelegateComponent
Component {
id: switchDelegateComponent
SwitchDelegate {
text: labelText
}
} // switchDelegateComponent
ColumnLayout {
id: column
spacing: 40
anchors.fill: parent
anchors.topMargin: 20
Label {
Layout.fillWidth: true
wrapMode: Label.Wrap
horizontalAlignment: Qt.AlignHCenter
text: "Delegate controls are used as delegates in views such as ListView."
}
ListView {
id: listView
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: ListModel {
ListElement { type: "ItemDelegate"; text: "ItemDelegate1" }
ListElement { type: "ItemDelegate"; text: "ItemDelegate2" }
ListElement { type: "ItemDelegate"; text: "ItemDelegate3" }
ListElement { type: "SwipeDelegate"; text: "SwipeDelegate1" }
ListElement { type: "SwipeDelegate"; text: "SwipeDelegate2" }
ListElement { type: "SwipeDelegate"; text: "SwipeDelegate3" }
ListElement { type: "CheckDelegate"; text: "CheckDelegate1" }
ListElement { type: "CheckDelegate"; text: "CheckDelegate2" }
ListElement { type: "CheckDelegate"; text: "CheckDelegate3" }
ListElement { type: "RadioDelegate"; text: "RadioDelegate" }
ListElement { type: "RadioDelegate"; text: "RadioDelegate" }
ListElement { type: "RadioDelegate"; text: "RadioDelegate" }
ListElement { type: "SwitchDelegate"; text: "SwitchDelegate" }
ListElement { type: "SwitchDelegate"; text: "SwitchDelegate" }
ListElement { type: "SwitchDelegate"; text: "SwitchDelegate" }
} // ListModel
section.property: "type"
section.delegate: Pane {
id: paneLoader
width: listView.width
height: sectionLabel.implicitHeight + 20
Rectangle {
width: listView.width
height: sectionLabel.implicitHeight + 20
color: "lightsteelblue"
Label {
id: sectionLabel
text: section
anchors.centerIn: parent
}
}
} // paneLoader
delegate: Loader {
id: delegateLoader
width: listView.width
sourceComponent: delegateComponentMap[text]
property string labelText: text
property ListView view: listView
property int ourIndex: index
// Can not find a way to do this in the SwipeDelegate component itself
// so do it here instead.
ListView.onRemove: SequentialAnimation {
id: delegateAnimation
PropertyAction {
target: delegateLoader
property: "ListView.delayRemove"
value: true
}
NumberAnimation {
target: item
property: "height"
to: 0
easing.type: Easing.InOutQuad
}
PropertyAction {
target: delegateLoader
property: "ListView.delayRemove"
value: false
}
} // delegateAnimation
} // delegateLoader
} // listView
} // column
} // pane
*/

View File

@@ -0,0 +1,70 @@
/*
* 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 QtGraphicalEffects 1.0
Item {
property Component mycomponent: userImage
QtObject {
id: internalSettings
// Hiedemann: Logo-Farbe "Rot"
property color color: "#6f1a32"
//property radius radius: 48
}
Component {
id: userImage
Rectangle {
id: imageRoot;
width: 96
height: 96
radius: 48
Image {
id: sourceImage
sourceSize: Qt.size(parent.width, parent.height)
//height: parent.height
//height: parent.width
fillMode: Image.PreserveAspectFit
smooth: false
anchors.fill: parent
source: "/images/nobody.png"
//sourceSize: Qt.size(parent.width, parent.height)
}
Rectangle {
id: maskImage
//sourceSize: Qt.size(parent.width, parent.height)
radius: parent.radius
color: internalSettings.color
}
OpacityMask {
anchors.fill: sourceImage
source: sourceImage
maskSource: maskImage
}
} // imageRoot
} // userImage
} // Item

View File

@@ -0,0 +1,64 @@
/*
* 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.0
Item {
id: delegate
width: parent.width
//width: delegate.ListView.view.width;
//width: parent.width - parent.leftMargin - parent.rightMargin
height: 30
clip: true
//anchors.margins: 4
Row {
anchors.margins: 4
anchors.fill: parent
spacing: 4;
TextField {
text: model.userId
onEditingFinished: model.userId = text
//width: 50
}
TextField {
text: lastName
onEditingFinished: model.lastName = text
//width: 150;
}
TextField {
text: firstName
onEditingFinished: model.firstName = text
//width: 50;
}
TextField {
text: email
onEditingFinished: model.email = text
//width: 100;
}
TextField {
text: userInitials
onEditingFinished: model.userInitials = text
//width: 50;
}
TextField {
text: roleName
//width: 150;
}
}
}

View 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
// 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
}
}
}

View File

@@ -0,0 +1,164 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.6
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import io.qt.chatexample 1.0
Page {
id: userRoleChanges
property string changeUserRole
header: UserRoleToolBar {
ToolButton {
text: qsTr("Back")
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: drawer.StackView.view.pop()
}
Label {
id: pageTitle
text: changeUserRole
font.pixelSize: 20
anchors.centerIn: parent
}
}
ColumnLayout {
anchors.fill: parent
ListView {
id: listView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: pane.leftPadding + messageField.leftPadding
displayMarginBeginning: 40
displayMarginEnd: 40
verticalLayoutDirection: ListView.TopToBottom
spacing: 12
model: SqlUserRoleChangesModel
delegate: Column {
//anchors.right: sentByMe ? parent.right : undefined
spacing: 6
//readonly property bool sentByMe: model.recipient !== "Me"
Row {
id: UserRoleRow
spacing: 6
//anchors.right: sentByMe ? parent.right : undefined
Rectangle {
//width: Math.min(messageText.implicitWidth + 24, listView.width - avatar.width - messageRow.spacing)
width: messageText.implicitWidth + 24
height: messageText.implicitHeight + 24
color: sentByMe ? "lightgrey" : "steelblue"
Label {
id: roleId
text: model.roleId
color: "black"
anchors.fill: parent
anchors.margins: 12
}
Label {
id: RoleName
text: model.roleName
color: "black"
anchors.fill: parent
anchors.margins: 12
}
}
}
Label {
id: timestampLastChanged
text: Qt.formatDateTime(model.timestamp, "d MMM hh:mm")
color: "lightgrey"
//anchors.right: sentByMe ? parent.right : undefined
}
}
ScrollBar.vertical: ScrollBar {}
}
Pane {
id: pane
Layout.fillWidth: true
RowLayout {
width: parent.width
TextArea {
id: messageField
Layout.fillWidth: true
placeholderText: qsTr("Compose message")
wrapMode: TextArea.Wrap
}
Button {
id: sendButton
text: qsTr("Send")
enabled: messageField.length > 0
onClicked: {
listView.model.sendMessage(inConversationWith, messageField.text);
messageField.text = "";
}
}
}
}
}
}

View File

@@ -0,0 +1,49 @@
/*
* 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.0
Item {
id: delegate
width: delegate.ListView.view.width;
//width: parent.width - parent.leftMargin - parent.rightMargin
height: 30
clip: true
//anchors.margins: 4
Row {
anchors.margins: 4
anchors.fill: parent
spacing: 4;
Text {
text: model.id
}
Text {
text: model.userRoleId
}
Text {
text: model.userRoleName
}
Text {
text: model.roleName
}
Text {
text: model.dateChanged
}
}
}

View 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
}

View File

@@ -0,0 +1,124 @@
/*
* 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
// our adapted Module
import de.networkx.AdvoTracker 1.0 as Nwx
Pane {
id: userRoleTable
// define a new qml: UserRoleToolBar
// ToolBar {
// }
//header: userRoleToolBar
/*
header: ToolBar {
ToolButton {
text: qsTr("Back")
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
onClicked: root.StackView.view.pop()
}
Label {
text: qsTr("Available User Roles")
font.pixelSize: 12
anchors.centerIn: parent
}
}
*/
ColumnLayout {
anchors.fill: parent
ListView {
id: listViewUserRoles
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: userRoleTable.leftPadding
displayMarginBeginning: 40
displayMarginEnd: 40
spacing: 6
model: visualModel
ScrollBar.vertical: ScrollBar {
//policy: AlwaysVisible
}
}
}
DelegateModel {
id: visualModel
model: modelUserRole
delegate: ItemDelegate {
//anchors.left: parent.left
id: itemDelegateUserRole
width: parent.width
spacing: 6
contentItem: Frame {
id: frameUserRole
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
}
*/
} // frameUserRole
} // rowUserRole
} // itemDelegateUserRole
}
} // Pane

View File

@@ -0,0 +1,559 @@
/* AdvoTracker - Hotline tracking tool for Advocats
*
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
* SPDX-License-Identifier: (0BSD or MIT)
*/
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.1
import QtQuick.Controls.Universal 2.1
import Qt.labs.settings 1.0
import RustCode 1.0
// AdvoTracker Module
//import de.networkx.AdvoTracker 1.0 as Nwx
ApplicationWindow {
id: windowMain
visible: true
property int margin: 5
property bool authenticated: false
title: "AdvoTracker"
width: minimumWidth
height: minimumHeight
//minimumWidth: Math.max(toolBarMain.implicitWidth, (advotrackerLabel.implicitWidth + 2 * paneMain.padding))
minimumWidth: Math.max(toolBarMain.implicitWidth, (customerLogo.implicitWidth + 2 * paneMain.padding))
//minimumHeight: columnMain.implicitHeight
//minimumWidth: 50
minimumHeight: 680
Settings {
id: settings
property string style: "Default"
}
Action {
id: actionStackPrevious
shortcut: ["Esc", "Back", "Ctrl+Left", "p"]
enabled: stackViewMain.depth > 1
onTriggered: {
stackViewMain.pop()
listViewDrawerMain.currentIndex = -1
}
}
Action {
id: actionStackNext
shortcut: ["Ctrl+Right"]
enabled: stackViewMain.depth > 1
onTriggered: {
listViewDrawerMain.currentIndex = +1
stackViewMain.push(listViewMain.source)
}
}
Action {
id: actionStackTest
shortcut: ["Ctrl+Alt+t"]
enabled: stackViewMain.depth > 1
onTriggered: {
listViewDrawerMain.currentIndex = +1
stackView.push("qrc:/TestPage.qml", {user_info: user_data})
}
}
Action {
id: actionAbout
text: Nwx.MdiFont.Icon.helpCircleOutline + " " + qsTr("&About")
shortcut: "Ctrl+A"
onTriggered: dialogAbout.open()
}
Action {
id: actionCopy
text: Nwx.MdiFont.Icon.contentCopy + " " + qsTr("&Copy")
//iconName: "copy"
enabled: (!!activeFocusItem && !!activeFocusItem["copy"])
shortcut: StandardKey.Copy
onTriggered: window.activeFocusItem.copy()
}
Action {
id: actionCut
text: Nwx.MdiFont.Icon.contentCut + " " + qsTr("Cu&t")
//icon.name: "cut"
shortcut: StandardKey.Cut
//tooltip: "Cut marked text"
//shortcut: "Ctrl+X"
//onTriggered: window.activeFocusItem.cut()
}
Action {
id: actionExport
text: Nwx.MdiFont.Icon.export + " " + qsTr("E&xport")
shortcut: "Alt+X"
}
Action {
id: actionMenu
shortcut: "Ctrl+M"
onTriggered: menuOptions.open()
}
Action {
id: actionQuit
text: Nwx.MdiFont.Icon.closeCircleOutline + " " + qsTr("&Quit")
icon.name: "eject"
shortcut: "Ctrl+Q"
onTriggered: quitDialog.open()
}
Action {
id: actionPaste
text: Nwx.MdiFont.Icon.contentPaste + " " + qsTr("P&aste")
shortcut: StandardKey.Paste
//shortcut: "Ctrl+V"
onTriggered: window.activeFocusItem.paste()
}
Action {
id: actionSettings
text: Nwx.MdiFont.Icon.settings + " " + qsTr("Settings")
//shortcut: "Ctrl+S"
//onTriggered: window.activeFocusItem.paste()
}
Action {
id: actionUserChange
text: Nwx.MdiFont.Icon.accountSettings + " " + qsTr("&User Settings")
shortcut: "Ctrl+C"
onTriggered: {
stackViewMain.push("qrc:/pages/UserPage.qml");
//changeUserDrawer.open()
}
}
Action {
id: actionUserNew
text: Nwx.MdiFont.Icon.accountPlus + " " + qsTr("&New User")
shortcut: "Ctrl+N"
onTriggered: {
stackViewMain.push("qrc:/pages/NewUserPage.qml");
//newUserDrawer.open()
}
}
Action {
id: actionUserRemove
text: Nwx.MdiFont.Icon.accountRemove + " " + qsTr("&Remove User")
shortcut: "Ctrl+R"
onTriggered: {
//source: "qrc:/pages/NewUserPage.qml";
stackViewMain.push("qrc:/pages/NewUserPage.qml");
//newUserDrawer.open()
}
}
header: ToolBar {
id: toolBarMain
Material.foreground: "white"
Layout.fillWidth: true
RowLayout {
spacing: 15
anchors.fill: parent
Layout.fillWidth: true
ToolButton {
id: toolButtonMain
//icon.name: stackViewMain.depth > 1 ? "back" : "drawer"
text: stackViewMain.depth > 1 ? Nwx.MdiFont.Icon.arrowLeft : Nwx.MdiFont.Icon.menu
font.pixelSize: 28
onClicked: {
if (stackViewMain.depth > 1) {
stackViewMain.pop()
listViewDrawerMain.currentIndex = -1
} else {
drawerMain.open()
}
}
}
Label {
id: titleLabel
text: listViewDrawerMain.currentItem ? listViewDrawerMain.currentItem.text : "Hiedemann Rechtsanwälte"
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true
}
Label {
text: Nwx.MdiFont.Icon.account
// only show account-icon, if authentication succeeded
opacity: authenticated ? 1.0 : 0
anchors.right: menuMain.left
}
ToolButton {
id: menuMain
text: Nwx.MdiFont.Icon.dotsVertical
font.pixelSize: 28
action: actionMenu
Menu {
id: menuOptions
title: qsTr("Menu")
x: parent.width - width
transformOrigin: Menu.TopRight
Menu {
id: menuEdit
title: Nwx.MdiFont.Icon.pencil + " " + qsTr("Edit")
//title: qsTr("Edit")
MenuItem {
id: menuOptionsCut
action: actionCut
}
MenuItem {
id: menuOptionsCopy
action: actionCopy
}
MenuItem {
id: menuOptionsPaste
action: actionPaste
}
}
MenuSeparator { }
Menu {
id: menuOptionsSettings
title: Nwx.MdiFont.Icon.settings + " " + qsTr("Settings")
//action: actionSettings
MenuItem {
text: Nwx.MdiFont.Icon.settingsBox + " " + qsTr("Dialog Settings")
//text: qsTr("Dialog Settings")
//action: actionDialog
onTriggered: dialogSettings.open()
}
Menu {
id: menuUserSettings
title: Nwx.MdiFont.Icon.accountSettingsVariant + " " + qsTr("User Settings")
//title: qsTr("User Settings")
MenuItem {
id: menuOptonsUserChange
action: actionUserChange
}
MenuItem {
id: menuOptionsUserNew
action: actionUserNew
}
}
}
MenuSeparator { }
MenuItem {
id: menuOptionsAbout
action: actionAbout
}
MenuSeparator { }
MenuItem {
id: menuOptionsQuit
action: actionQuit
//onPressed: quitDialog.open()
}
} // menuOptions
}
}
}
Drawer {
id: drawerMain
width: Math.min(windowMain.width, windowMain.height) / 4 * 2
height: Math.min(windowMain.height) / 4 * 2
interactive: stackViewMain.depth === 1
ListView {
id: listViewDrawerMain
focus: true
currentIndex: -1
anchors.fill: parent
model: ListModel {
ListElement { title: qsTr("Login Page"); source: "qrc:/pages/LoginPage.qml" }
ListElement { title: qsTr("List of claims"); source: "qrc:/pages/PageNumberHarmList.qml" }
//ListElement { title: qsTr("Case of damage"); source: "qrc:/pages/PageNumberHarm.qml" }
ListElement { title: qsTr("List of users"); source: "qrc:/pages/PageUserList.qml" }
ListElement { title: qsTr("List of user roles"); source: "qrc:/pages/UserRoleTablePage.qml" }
//ListElement { title: qsTr("User Roles List"); source: "qrc:/pages/UserRoleListPage.qml" }
//ListElement { title: qsTr("User List"); source: "qrc:/pages/UserListPage.qml" }
//ListElement { title: qsTr("User Roles List"); source: "qrc:/pages/UserRoleListPage.qml" }
//ListElement { title: qsTr("TableView Page"); source: "qrc:/pages/TableViewPage.qml" }
//ListElement { title: qsTr("SqlView Page"); source: "qrc:/pages/SqlViewPage.qml" }
ListElement { title: qsTr("List of MaterialIcons"); source: "qrc:/pages/MaterialIconsPage.qml" }
ListElement { title: qsTr("Case of damage (static)"); source: "qrc:/pages/PageNumberHarmStatic.qml" }
ListElement { title: qsTr("Test UserModel Page"); source: "qrc:/pages/UserModelPage.qml" }
ListElement { title: qsTr("Test Page"); source: "qrc:/pages/TestPage.qml" }
ListElement { title: qsTr("SqlTest Page"); source: "qrc:/pages/SqlTestPage.qml" }
ListElement { title: qsTr("SwipeDelegate Page"); source: "qrc:/pages/SwipeDelegatePage.qml" }
}
delegate: ItemDelegate {
width: parent.width
text: model.title
//highlighted: listViewDrawerMain.isCurrentItem
//highlighted: drawerMain.listviewDrawerMain.isCurrentItem
highlighted: ListView.isCurrentItem
onPressed: {
listViewDrawerMain.currentIndex = index
stackViewMain.push(model.source)
drawerMain.close()
}
}
}
} // drawerMain
StackView {
id: stackViewMain
anchors.fill: parent
initialItem: Pane {
id: paneMain
padding: 15
ColumnLayout {
id: columnMain
anchors.fill: parent
Image {
id: customerLogo
source: "images/customer_logo.jpg"
fillMode: Image.PreserveAspectFit
anchors.top: parent.top
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
} // customerLogo
//Nwx.Label {
Label {
id: advotrackerLabel
text: qsTr("AdvoTracker© - hotline records for advocats")
//anchors.top: customerLogo.bottom
anchors.bottom: parent.bottom
//anchors.topMargin: 12
Layout.alignment: Qt.AlignHCenter
//Layout.fillWidth: true
//anchors.bottom: networkxRow.top
} // advotrackerLabel
/* networkxRox
RowLayout {
id: networkxRow
opacity: 0
Layout.alignment: Qt.AlignVCenter | Qt.AlignBaseline
//Layout.fillWidth: true
//width: paneMain.availableWidth / 6 * 1
//height: paneMain.availableHeight / 6 * 1
anchors.top: advotrackerLabel.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
//anchors.topMargin: 18
//Layout.minimumWidth: 150
//Layout.preferredWidth: 150
//spacing: 2
Label {
id: networkxLabel
text: qsTr("created by")
antialiasing: true
font.pointSize: 9
}
Image {
id: networkxLogo
//anchors.top: networkxLabel
source: "images/networkx_logo.jpg"
//anchors.right: paneMain.right
//anchors.bottom: paneMain.bottom
sourceSize.width: 1024
sourceSize.height: 1024
Layout.preferredWidth: sourceSize.width / 15
Layout.preferredHeight: sourceSize.height / 18
//width: paneMain.availableWidth / 10
//height: paneMain.availableHeight / 100 * 8
//text: "© Networkx GmbH"
//fillMode: networkxLogo.PreserveAspectFit
//fillMode: networkxLogo.PreserveAspectCrop
//clip: true
} // networkxLogo
} // networkxRow
*/ //networkxRox
} // columnViewMain
} // paneMain
} // stackViewMain
Dialog {
id: dialogSettings
x: Math.round((windowMain.width - width) / 2)
y: Math.round(windowMain.height / 6)
width: Math.round(Math.min(windowMain.width, windowMain.height) / 3 * 2)
modal: true
focus: true
title: "Settings"
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: {
settings.style = styleBox.displayText
dialogSettings.close()
}
onRejected: {
styleBox.currentIndex = styleBox.styleIndex
dialogSettings.close()
}
contentItem: ColumnLayout {
id: settingsColumn
spacing: 20
RowLayout {
spacing: 10
//Nwx.Label {
Label {
text: "Style:"
}
ComboBox {
id: styleBox
property int styleIndex: -1
model: availableStyles
Component.onCompleted: {
styleIndex = find(settings.style, Qt.MatchFixedString)
if (styleIndex !== -1)
currentIndex = styleIndex
}
Layout.fillWidth: true
}
}
//Nwx.Label {
Label {
text: "Restart required"
opacity: styleBox.currentIndex !== styleBox.styleIndex ? 1.0 : 0.0
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
Layout.fillWidth: true
Layout.fillHeight: true
}
}
} // dialogSettings
Dialog {
id: dialogAbout
modal: true
focus: true
title: "About"
width: Math.min(windowMain.width, windowMain.height) / 3 * 2
contentHeight: aboutColumn.height
x: (windowMain.width - width) / 2
y: windowMain.height / 6
Column {
id: aboutColumn
spacing: 20
//Nwx.Label {
Label {
width: dialogAbout.availableWidth
text: "AdvoTracker verwendet Qt."
wrapMode: Label.Wrap
//font.pixelSize: 12
}
//Nwx.Label {
Label {
width: dialogAbout.availableWidth
text: "Mit Qt Quick Controls 2, einer schnellen Multiplattform GUI, "
+ "ist AdvoTracker bereits bestens für Android und andere "
+ "mobile Plattformen vorbereitet ..."
wrapMode: Label.Wrap
//font.pixelSize: 12
}
}
MouseArea {
id: mouseAreaDialogAbout
width: parent.width
height: parent.height
onClicked: dialogAbout.close()
}
} // dialogAbout
Dialog {
id: quitDialog
modal: true
focus: true
x: (windowMain.width - width) / 2
y: windowMain.height / 6
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: {
settings.style = styleBox.displayText
Qt.quit()
}
onRejected: {
styleBox.currentIndex = styleBox.styleIndex
dialogSettings.close()
}
contentItem: ColumnLayout {
id: quitColumn
spacing: 20
RowLayout {
spacing: 10
//Nwx.Label {
Label {
text: qsTr("Do you realy want to quit AdvoTracker?")
}
}
}
} // dialogQuit
Dialog {
id: newUserDrawer
width: windowMain.width
height: windowMain.height
//width: Math.min(windowMain.width, parent.height) / 4 * 2
//height: Math.min(windowMain.height) / 4 * 2
title: qsTr("New User")
modal: true
focus: true
enter: Transition {
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition {
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
Loader {
//id: newUserLoader
anchors.fill: parent
anchors.centerIn: parent
//sourceComponent: rect
source: "qrc:/pages/NewUserPage.qml"
}
} // newUserDrawer
} // windowMain