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,25 @@
[package]
name = "advotracker_qml"
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
description = "Frontend component that supports lawyers to capture relevant data encountered during an online legal advice\n"
documentation = "https://docs.rs/advotracker"
edition = "2018"
homepage = "https://github.com/rzerres/advotracker"
license = "(0BSD OR MIT)"
readme = "README.md"
repository = "https://github.com/rzerres/advotracker"
version = "0.1.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["winuser"] }
#diesel = { version = "1.4", features = [ "postgres", "sqlite" ] }
[dependencies]
cstr = { version = "0.1.7" }
qmetaobject = { version = "0.1.4" }
#qmetaobjects = { git = "https://github.com/woboq/qmetaobject-rs.git", branch = "master" }
# [features]
# # no features by default
# default = []
# light-theme = []

56
advotracker_qml/README.md Executable file
View File

@@ -0,0 +1,56 @@
<!-- AdvoTracker.markdown -->
<!-- version: 1.1 -->
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
<!-- markdown-toc end -->
# AdvoTracker - Hotline tool für Advokaten #
AdvoTracker unterstützt Anwälte bei der Erfassung von Mandatsdaten zu einer Online-Beratung.
Das Tool wurde als 'Multi-Pattform' Anwendung mit der Programmiersprache 'Rust' [rust-documentation][^2]
umgesetzt.
Die Implementierung der Benutzer-Schnittstelle (GUI) verwendet das 'Qt-QML' Modul aus dem Qt Framework.
Die Anbindung von QML in Rust erfolgt über das Crate 'QMetaObject'.
Alle verwendeten Komponenten liegen als Open-Source Projekte im Quellcode vor. Für eine eingehend
Dokumentation wird auf die offiziellen Projektseiten für Qt [qt5-documentation][^2], bzw.
QML [qml-documentation][<3] verwiesen.
# Internationalisierung #
AdvoTracker wurde mit Unterstützung der Mehrsprachenfähigkeit implementiert.
Existieren für die im Betriebssystem verwendeten Sprache (Umgebungsvariable LOCALE) bereits übersetzungen,
werden diese in allen Dialogen verwendet.
## Übersetzungen für neue Sprachen ##
* neue Sprache in Projektdatei (Advotracker.pro) ergänzen
z.B. für Französisch: advotracker_fr.ts
* Metadateien mit den Sprachespezifischen Variablen erzeugen
lupdate AdvoTracker.pro
* Textvariablen in Metadateien übersetzen
linguist advotracker_fr.ts
* Sprachdatei erzeugen
lrelease AdvoTracker.pro
Die zu verwendende Sprache wird aus der in der Umgebungsvariable des Betriebssystems hinterlegten Sprache
ausgewählt.
---
[Logo-CC_BY]: https://i.creativecommons.org/l/by/4.0/88x31.png "Creative Common Logo"
[License-CC_BY]: https://creativecommons.org/licenses/by/4.0/legalcode "Creative Common License"
This work is licensed under a [Creative Common License 4.0][License-CC_BY]
![Creative Common Logo][Logo-CC_BY]
© 2020 Networkx GmbH
---
Foodnotes
[^1]: Online Dokumentation: https://www.rust-lang.org
[^2]: Online Dokumentation: https://doc.qt.io/qt-5
[^3]: Online Dokumentation: https://doc.qt.io/qt-5/qtqml-index.html

View File

@@ -0,0 +1,66 @@
<RCC>
<qresource prefix="/">
<file>qt-project.org/imports/de/networkx/AdvoTracker/qmldir</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/AdvoTracker.qmltypes</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/Button.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/CheckBox.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/MdiFont.js</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/IconLabel.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/IconButton.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/Label.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/TextField.qml</file>
<file>qt-project.org/imports/de/networkx/AdvoTracker/ScrollBar.qml</file>
<file>advotracker.qml</file>
<file>translations/advotracker_de.qm</file>
<file>fonts/materialdesignicons-webfont.ttf</file>
<file>pages/LoginPage.qml</file>
<file>pages/RectanglesTab.qml</file>
<file>pages/UserImage.qml</file>
<file>images/advotracker.jpg</file>
<file>images/arrow.png</file>
<file>images/arrow@2x.png</file>
<file>images/arrow@3x.png</file>
<file>images/arrow@4x.png</file>
<file>images/arrows.png</file>
<file>images/arrows@2x.png</file>
<file>images/arrows@3x.png</file>
<file>images/arrows@4x.png</file>
<file>images/background.jpg</file>
<file>images/customer_logo.jpg</file>
<file>images/networkx_logo.jpg</file>
<file>images/nobody.png</file>
<file>icons/advotracker/20x20/back.png</file>
<file>icons/advotracker/20x20/drawer.png</file>
<file>icons/advotracker/20x20/menu.png</file>
<file>icons/advotracker/index.theme</file>
<file>icons/advotracker/20x20@2/back.png</file>
<file>icons/advotracker/20x20@2/drawer.png</file>
<file>icons/advotracker/20x20@2/menu.png</file>
<file>icons/advotracker/20x20@3/back.png</file>
<file>icons/advotracker/20x20@3/drawer.png</file>
<file>icons/advotracker/20x20@3/menu.png</file>
<file>icons/advotracker/20x20@4/back.png</file>
<file>icons/advotracker/20x20@4/drawer.png</file>
<file>icons/advotracker/20x20@4/menu.png</file>
<file>pages/LoginPage.qml</file>
<file>pages/MaterialIconsPage.qml</file>
<file>pages/NewUserPage.qml</file>
<file>pages/NumberHarmList.qml</file>
<file>pages/PageNumberHarm.qml</file>
<file>pages/PageNumberHarmStatic.qml</file>
<file>pages/PaneNumberHarmAdmin.qml</file>
<file>pages/PaneNumberHarmData.qml</file>
<file>pages/SearchToolBar.qml</file>
<file>pages/SqlTestPage.qml</file>
<file>pages/SqlViewPage.qml</file>
<file>pages/SwipeDelegatePage.qml</file>
<file>pages/TestPage.qml</file>
<file>pages/UserItemDelegate.qml</file>
<file>pages/UserListPage.qml</file>
<file>pages/UserList.qml</file>
<file>pages/UserRoleListPage.qml</file>
<file>pages/UserModelPage.qml</file>
<file>pages/UserRoleItemDelegate.qml</file>
<file>pages/UserRoleTablePage.qml</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,11 @@
<!--?xml version="1.0" encoding="UTF-8"?-->
<resources>
<color name="primaryColor">#5b0c22</color>
<color name="primaryLightColor">#8c3b49</color>
<color name="primaryDarkColor">#320000</color>
<color name="secondaryColor">#e1d2e5</color>
<color name="secondaryLightColor">#ffffff</color>
<color name="secondaryDarkColor">#afa1b3</color>
<color name="primaryTextColor">#ffffff</color>
<color name="secondaryTextColor">#000000</color>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -0,0 +1,24 @@
[Icon Theme]
Name=AdvoTracker
Comment=AdvoTracker Icon Theme
Directories=20x20,20x20@2,20x20@3,20x20@4
[20x20]
Size=20
Type=Fixed
[20x20@2]
Size=20
Scale=2
Type=Fixed
[20x20@3]
Size=20
Scale=3
Type=Fixed
[20x20@4]
Size=20
Scale=4
Type=Fixed

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

View File

@@ -0,0 +1,650 @@
import QtQuick.tooling 1.2
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump de.networkx.AdvoTracker 1.0 /home/ralf/projekte/Hiedemann/AdvoTracker/resources'
Module {
dependencies: [
"QtGraphicalEffects 1.0",
"QtQuick 2.8",
"QtQuick.Controls 2.3",
"QtQuick.Controls.Fusion 2.3",
"QtQuick.Controls.Fusion.impl 2.3",
"QtQuick.Controls.Imagine 2.3",
"QtQuick.Controls.Imagine.impl 2.3",
"QtQuick.Controls.Material 2.3",
"QtQuick.Controls.Material.impl 2.3",
"QtQuick.Controls.Universal 2.3",
"QtQuick.Controls.Universal.impl 2.3",
"QtQuick.Controls.impl 2.3",
"QtQuick.Templates 2.3",
"QtQuick.Window 2.3"
]
Component {
prototype: "QQuickAbstractButton"
name: "QtQuick.Controls/AbstractButton 2.0"
exports: ["QtQuick.Controls/AbstractButton 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickAction"
name: "QtQuick.Controls/Action 2.3"
exports: ["QtQuick.Controls/Action 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
}
Component {
prototype: "QQuickActionGroup"
name: "QtQuick.Controls/ActionGroup 2.3"
exports: ["QtQuick.Controls/ActionGroup 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "actions"
}
Component {
prototype: "QQuickApplicationWindow"
name: "QtQuick.Controls/ApplicationWindow 2.0"
exports: ["QtQuick.Controls/ApplicationWindow 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Material.impl/BoxShadow 2.0"
exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "offsetX"; type: "int" }
Property { name: "offsetY"; type: "int" }
Property { name: "blurRadius"; type: "int" }
Property { name: "spreadRadius"; type: "int" }
Property { name: "source"; type: "QQuickItem"; isPointer: true }
Property { name: "fullWidth"; type: "bool" }
Property { name: "fullHeight"; type: "bool" }
Property { name: "glowRadius"; type: "double" }
Property { name: "spread"; type: "double" }
Property { name: "color"; type: "QColor" }
Property { name: "cornerRadius"; type: "double" }
Property { name: "cached"; type: "bool" }
}
Component {
prototype: "QQuickBusyIndicator"
name: "QtQuick.Controls/BusyIndicator 2.0"
exports: ["QtQuick.Controls/BusyIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickButton"
name: "QtQuick.Controls/Button 2.0"
exports: ["QtQuick.Controls/Button 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickButtonGroup"
name: "QtQuick.Controls/ButtonGroup 2.0"
exports: ["QtQuick.Controls/ButtonGroup 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/ButtonPanel 2.3"
exports: ["QtQuick.Controls.Fusion.impl/ButtonPanel 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "highlighted"; type: "bool" }
}
Component {
prototype: "QQuickCheckBox"
name: "QtQuick.Controls/CheckBox 2.0"
exports: ["QtQuick.Controls/CheckBox 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickCheckDelegate"
name: "QtQuick.Controls/CheckDelegate 2.0"
exports: ["QtQuick.Controls/CheckDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Universal.impl/CheckIndicator 2.0"
exports: ["QtQuick.Controls.Universal.impl/CheckIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "partiallyChecked"; type: "bool"; isReadonly: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"
exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "pressedColor"; type: "QColor"; isReadonly: true }
Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0"
exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
}
Component {
prototype: "QQuickComboBox"
name: "QtQuick.Controls/ComboBox 2.0"
exports: ["QtQuick.Controls/ComboBox 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickContainer"
name: "QtQuick.Controls/Container 2.0"
exports: ["QtQuick.Controls/Container 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickControl"
name: "QtQuick.Controls/Control 2.0"
exports: ["QtQuick.Controls/Control 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Material.impl/CursorDelegate 2.0"
exports: ["QtQuick.Controls.Material.impl/CursorDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickDelayButton"
name: "QtQuick.Controls/DelayButton 2.2"
exports: ["QtQuick.Controls/DelayButton 2.2"]
exportMetaObjectRevisions: [2]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickDial"
name: "QtQuick.Controls/Dial 2.0"
exports: ["QtQuick.Controls/Dial 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickDialog"
name: "QtQuick.Controls/Dialog 2.1"
exports: ["QtQuick.Controls/Dialog 2.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickDialogButtonBox"
name: "QtQuick.Controls/DialogButtonBox 2.1"
exports: ["QtQuick.Controls/DialogButtonBox 2.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickDrawer"
name: "QtQuick.Controls/Drawer 2.0"
exports: ["QtQuick.Controls/Drawer 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0"
exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "source"; type: "QVariant" }
Property { name: "elevation"; type: "int" }
Property { name: "fullWidth"; type: "bool" }
Property { name: "fullHeight"; type: "bool" }
Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "_shadows"; type: "QVariant"; isReadonly: true }
Property { name: "_shadow"; type: "QVariant"; isReadonly: true }
}
Component {
prototype: "QQuickFrame"
name: "QtQuick.Controls/Frame 2.0"
exports: ["QtQuick.Controls/Frame 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickGroupBox"
name: "QtQuick.Controls/GroupBox 2.0"
exports: ["QtQuick.Controls/GroupBox 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickItemDelegate"
name: "QtQuick.Controls/ItemDelegate 2.0"
exports: ["QtQuick.Controls/ItemDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickLabel"
name: "QtQuick.Controls/Label 2.0"
exports: ["QtQuick.Controls/Label 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickMenu"
name: "QtQuick.Controls/Menu 2.0"
exports: ["QtQuick.Controls/Menu 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickMenuBar"
name: "QtQuick.Controls/MenuBar 2.3"
exports: ["QtQuick.Controls/MenuBar 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickMenuBarItem"
name: "QtQuick.Controls/MenuBarItem 2.3"
exports: ["QtQuick.Controls/MenuBarItem 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickMenuItem"
name: "QtQuick.Controls/MenuItem 2.0"
exports: ["QtQuick.Controls/MenuItem 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickMenuSeparator"
name: "QtQuick.Controls/MenuSeparator 2.1"
exports: ["QtQuick.Controls/MenuSeparator 2.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickPage"
name: "QtQuick.Controls/Page 2.0"
exports: ["QtQuick.Controls/Page 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickPageIndicator"
name: "QtQuick.Controls/PageIndicator 2.0"
exports: ["QtQuick.Controls/PageIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickPane"
name: "QtQuick.Controls/Pane 2.0"
exports: ["QtQuick.Controls/Pane 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickPopup"
name: "QtQuick.Controls/Popup 2.0"
exports: ["QtQuick.Controls/Popup 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickProgressBar"
name: "QtQuick.Controls/ProgressBar 2.0"
exports: ["QtQuick.Controls/ProgressBar 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRadioButton"
name: "QtQuick.Controls/RadioButton 2.0"
exports: ["QtQuick.Controls/RadioButton 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRadioDelegate"
name: "QtQuick.Controls/RadioDelegate 2.0"
exports: ["QtQuick.Controls/RadioDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0"
exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"
exports: ["QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "pressedColor"; type: "QColor"; isReadonly: true }
Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0"
exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QVariant" }
}
Component {
prototype: "QQuickRangeSlider"
name: "QtQuick.Controls/RangeSlider 2.0"
exports: ["QtQuick.Controls/RangeSlider 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Material.impl/RectangularGlow 2.0"
exports: ["QtQuick.Controls.Material.impl/RectangularGlow 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "glowRadius"; type: "double" }
Property { name: "spread"; type: "double" }
Property { name: "color"; type: "QColor" }
Property { name: "cornerRadius"; type: "double" }
Property { name: "cached"; type: "bool" }
}
Component {
prototype: "QQuickRoundButton"
name: "QtQuick.Controls/RoundButton 2.1"
exports: ["QtQuick.Controls/RoundButton 2.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickScrollBar"
name: "QtQuick.Controls/ScrollBar 2.0"
exports: ["QtQuick.Controls/ScrollBar 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickScrollIndicator"
name: "QtQuick.Controls/ScrollIndicator 2.0"
exports: ["QtQuick.Controls/ScrollIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickScrollView"
name: "QtQuick.Controls/ScrollView 2.2"
exports: ["QtQuick.Controls/ScrollView 2.2"]
exportMetaObjectRevisions: [2]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickSlider"
name: "QtQuick.Controls/Slider 2.0"
exports: ["QtQuick.Controls/Slider 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/SliderGroove 2.3"
exports: ["QtQuick.Controls.Fusion.impl/SliderGroove 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "offset"; type: "double" }
Property { name: "progress"; type: "double" }
Property { name: "visualProgress"; type: "double" }
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Material.impl/SliderHandle 2.0"
exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "value"; type: "double" }
Property { name: "handleHasFocus"; type: "bool" }
Property { name: "handlePressed"; type: "bool" }
Property { name: "handleHovered"; type: "bool" }
Property { name: "initialSize"; type: "int"; isReadonly: true }
Property { name: "control"; type: "QVariant"; isReadonly: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3"
exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "palette"; type: "QVariant" }
Property { name: "pressed"; type: "bool" }
Property { name: "hovered"; type: "bool" }
Property { name: "vertical"; type: "bool" }
Property { name: "visualFocus"; type: "bool" }
}
Component {
prototype: "QQuickSpinBox"
name: "QtQuick.Controls/SpinBox 2.0"
exports: ["QtQuick.Controls/SpinBox 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickStackView"
name: "QtQuick.Controls/StackView 2.0"
exports: ["QtQuick.Controls/StackView 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickSwipeDelegate"
name: "QtQuick.Controls/SwipeDelegate 2.0"
exports: ["QtQuick.Controls/SwipeDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickSwipeView"
name: "QtQuick.Controls/SwipeView 2.0"
exports: ["QtQuick.Controls/SwipeView 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickSwitch"
name: "QtQuick.Controls/Switch 2.0"
exports: ["QtQuick.Controls/Switch 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickSwitchDelegate"
name: "QtQuick.Controls/SwitchDelegate 2.0"
exports: ["QtQuick.Controls/SwitchDelegate 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"
exports: ["QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
}
Component {
prototype: "QQuickItem"
name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0"
exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true }
}
Component {
prototype: "QQuickRectangle"
name: "QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3"
exports: ["QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3"]
exportMetaObjectRevisions: [3]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "pressedColor"; type: "QColor"; isReadonly: true }
Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true }
}
Component {
prototype: "QQuickTabBar"
name: "QtQuick.Controls/TabBar 2.0"
exports: ["QtQuick.Controls/TabBar 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickTabButton"
name: "QtQuick.Controls/TabButton 2.0"
exports: ["QtQuick.Controls/TabButton 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickTextArea"
name: "QtQuick.Controls/TextArea 2.0"
exports: ["QtQuick.Controls/TextArea 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickTextField"
name: "QtQuick.Controls/TextField 2.0"
exports: ["QtQuick.Controls/TextField 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickToolBar"
name: "QtQuick.Controls/ToolBar 2.0"
exports: ["QtQuick.Controls/ToolBar 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickToolButton"
name: "QtQuick.Controls/ToolButton 2.0"
exports: ["QtQuick.Controls/ToolButton 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickToolSeparator"
name: "QtQuick.Controls/ToolSeparator 2.1"
exports: ["QtQuick.Controls/ToolSeparator 2.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "data"
}
Component {
prototype: "QQuickToolTip"
name: "QtQuick.Controls/ToolTip 2.0"
exports: ["QtQuick.Controls/ToolTip 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "contentData"
}
Component {
prototype: "QQuickTumbler"
name: "QtQuick.Controls/Tumbler 2.0"
exports: ["QtQuick.Controls/Tumbler 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
}
}

View File

@@ -0,0 +1,67 @@
/*
* 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.impl 2.3
import QtQuick.Templates 2.3 as T
import QtQuick.Controls.Material 2.3 //Qt 5.10
T.Button {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 6
leftPadding: padding + 2
rightPadding: padding + 2
spacing: 6
icon.width: 24
icon.height: 24
icon.color: control.checked || control.highlighted ? control.palette.brightText :
control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
text: control.text
font: control.font
color: control.checked || control.highlighted ? control.palette.brightText :
control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
}
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
visible: !control.flat || control.down || control.checked || control.highlighted
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
control.palette.mid, control.down ? 0.5 : 0.0)
border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0
radius: 6
}
}

View File

@@ -0,0 +1,82 @@
/*
* 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.Templates 2.3 as T
import QtQuick.Controls 2.3
import QtQuick.Controls.impl 2.3
T.CheckBox {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
Math.max(contentItem.implicitHeight,
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 6
spacing: 6
// keep in sync with CheckDelegate.qml (shared CheckIndicator.qml was removed for performance reasons)
indicator: Rectangle {
implicitWidth: 28
implicitHeight: 28
//x: text ? (control.mirrored ? control.leftPadding + (control.availableWidth - width) / 2 : control.width - width - control.rightPadding : control.leftPadding)
x:text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
color: control.down ? control.palette.light : control.palette.base
border.width: control.visualFocus ? 2 : 1
border.color: control.visualFocus ? control.palette.highlight : control.palette.mid
radius: 6
ColorImage {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
defaultColor: "#353637"
color: control.palette.text
source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png"
visible: control.checkState === Qt.Checked
}
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: 16
height: 3
color: control.palette.text
visible: control.checkState === Qt.PartiallyChecked
radius: 6
}
}
contentItem: CheckLabel {
leftPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
//leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
//rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
text: control.text
font: control.font
color: control.palette.windowText
}
}

View File

@@ -0,0 +1,32 @@
/*
* 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
Button {
implicitHeight: 48
implicitWidth: 48
font.pointSize: 24
font.family: "Material Design Icons"
}

View File

@@ -0,0 +1,28 @@
/*
* 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.Controls.Material 2.3 // Qt 5.10
Text {
font.family: "Material Design Icons"
font.pixelSize: 48
opacity: 0.75
}

View File

@@ -0,0 +1,34 @@
/*
* 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 3 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.impl 2.3
import QtQuick.Templates 2.3 as T
import QtQuick.Controls.Material 2.3 //Qt 5.10
T.Label {
id: control
color: control.palette.windowText
linkColor: control.palette.link
renderType: Text.NativeRendering
fontSizeMode: Text.Fit
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
/*
* 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.Controls.Material 2.3 // Qt 5.10
ScrollBar {
id: control
size: 0.3
position: 0.2
active: true
orientation: Qt.Vertical
property string color
contentItem: Rectangle {
implicitWidth: 3
implicitHeight: 50
radius: width / 2
color: control.pressed ? Material.primary : Material.background
//color: control.pressed ? "#81e889" : "#b6c3b7"
}
}

View File

@@ -0,0 +1,37 @@
/*
* 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.Controls.Material 2.3 // Qt 5.10
ScrollIndicator {
id: control
size: 0.5
position: 0.3
active: true
orientation: Qt.Vertical
contentItem: Rectangle {
implicitWidth: 4
implicitHeight: 100
color: Material.color(Material.Primary, Material.Shade700)
//color: #c2f4c6"
}
}

View File

@@ -0,0 +1,73 @@
/*
* 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 3 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.impl 2.3
import QtQuick.Templates 2.3 as T
T.TextField {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0)
|| contentWidth + leftPadding + rightPadding
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
background ? background.implicitHeight : 0,
placeholder.implicitHeight + topPadding + bottomPadding)
padding: 4
leftPadding: padding + 4
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
verticalAlignment: TextInput.AlignVCenter
horizontalAlignment: TextInput.AlignLeft
antialiasing: true
renderType: TextInput.NativeRendering
PlaceholderText {
id: placeholder
x: control.leftPadding
y: control.topPadding
width: control.width - (control.leftPadding + control.rightPadding)
height: control.height - (control.topPadding + control.bottomPadding)
text: control.placeholderText
font: control.font
opacity: 0.4
color: control.palette.text
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
ToolTip.timeout: 2000
ToolTip.visible: pressed
}
background: Rectangle {
implicitWidth: 200
implicitHeight: 40
border.width: control.activeFocus ? 2 : 1
color: control.palette.base
border.color: control.activeFocus ? "#6f1a32" : "lightgrey"
//border.color: control.activeFocus ? control.palette.highlight : control.palette.mid
radius: 6
}
}

View File

@@ -0,0 +1,11 @@
module de.networkx.AdvoTracker
typeinfo AdvoTracker.qmltypes
Button 1.0 Button.qml
CheckBox 1.0 CheckBox.qml
IconButton 1.0 IconButton.qml
IconLabel 1.0 IconLabel.qml
Label 1.0 Label.qml
ScrollBar 1.0 ScrollBar.qml
ScrollIndicator 1.0 ScrollIndicator.qml
TextField 1.0 TextField.qml
MdiFont 1.0 MdiFont.js

View File

@@ -0,0 +1,45 @@
[Default]
Font\Family=Plex
Font\PointSize=20
[Material]
//Primary=#41cd52
//Accent=#41cd52
// Styleguide: https://doc.qt.io/qt-5.10/qtquickcontrols2-material.html#material-foreground-attached-prop
// Hiedemann red: #5b0f22
// Hiedemann lightgrey: #f0f0f0
// Google Indigo-bases: #5c6bc0
// Hiedemann blue: #a5b3bf
// Hiedemann darkgrey: #879488
// Hiedemann grey:: #b6c3b7
Primary=#b6c3b7
//Primary= #5b0f22
Accent=#5b0f22
Foreground=#000000
Background=#f0f0f0
Theme=System
//Theme=Dark
//Theme=Light
[Material\Font]
Family=Plex
//Family=Open Sans
PointSize=11
[Fusion\Palette]
Window=#dedede
WindowText=#212121
[Fusion\Font]
Family=Plex
PointSize=9
[Universal]
Theme=System
//Theme=Dark
//Accent=Red
//Accent=#5b0f22
[Universal\Font]
Family=Plex
PointSize=11

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
/* advotracker infrastructure.
*
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
* SPDX-License-Identifier: (0BSD or MIT)
*/
//#[macro_use] extern crate cstr;
extern crate qmetaobject;
use qmetaobject::*;
use std::ffi::CStr;
mod qml;
mod number_harm;
// make files available to the Qt resource system
qrc!(advotracker_resource,
"/" {
"resources/icons/advotracker/index.theme",
"resources/icons/advotracker/20x20/back.png",
"resources/icons/advotracker/20x20/drawer.png",
"resources/icons/advotracker/20x20/menu.png",
"resources/icons/advotracker/20x20@2/back.png",
"resources/icons/advotracker/20x20@2/drawer.png",
"resources/icons/advotracker/20x20@2/menu.png",
"resources/icons/advotracker/20x20@3/back.png",
"resources/icons/advotracker/20x20@3/drawer.png",
"resources/icons/advotracker/20x20@3/menu.png",
"resources/icons/advotracker/20x20@4/back.png",
"resources/icons/advotracker/20x20@4/drawer.png",
"resources/icons/advotracker/20x20@4/menu.png",
"resources/images/background.jpg" as "pages/images/background.jpg",
"resources/images/customer_logo.jpg" as "pages/images/customer_logo.jpg",
"resources/images/networkx_logo.jpg" as "pages/images/networkx_logo.jpg",
"resources/images/nobody.png" as "pages/images/nobody.png",
"resources/pages/advotracker.qml" as "pages/advotracker.qml",
"resources/pages/LoginPage.qml" as "pages/LoginPage.qml",
"resources/pages/MaterialIconsPage.qml" as "pages/MaterialIconsPage.qml",
"resources/pages/NewUserPage.qml" as "pages/NewUserPage.qml",
"resources/pages/PageNumberHarmList.qml" as "pages/PageNumberHarmList.qml",
"resources/pages/PageNumberHarm.qml" as "pages/PageNumberHarm.qml",
//"resources/pages/PageUserDegate.qml" as "pages/PageUserDelegate.qml",
"resources/pages/PageUserDetail.qml" as "pages/PageUserDetail.qml",
"resources/pages/PageUserEdit.qml" as "pages/PageUserEdit.qml",
"resources/pages/PageUserList.qml" as "pages/PageUserList.qml",
"resources/pages/PaneNumberHarmAdmin.qml" as "pages/PaneNumberHarmAdmin.qml",
"resources/pages/PaneNumberHarmData.qml" as "pages/PaneNumberHarmData.qml",
"resources/pages/RectanglesTab.qml" as "pages/RectanglesTab.qml",
"resources/pages/SearchToolBar.qml" as "pages/SearchToolBar.qml",
"resources/pages/SqlTestPage.qml" as "pages/SqlTestPage.qml",
"resources/pages/SqlViewPage.qml" as "pages/SqlViewPage.qml",
"resources/pages/SwipeDelegatePage.qml" as "pages/SwipeDelegatePage.qml",
"resources/pages/TestPage.qml" as "pages/TestPage.qml",
// "resources/pages/UserImage.qml" as "pages/UserImage.qml",
//"resources/pages/UserImageDelegate.qml" as "pages/UserImageDelegate.qml",
"resources/pages/UserModelPage.qml" as "pages/UserModelPage.qml",
"resources/pages/UserRoleChangesPage.qml" as "pages/UserRoleChangesPage.qml",
//"resources/pages/UserRoleItemDelegatePage.qml" as "pages/UserRoleItemDelegatePage.qml",
"resources/pages/UserRoleListPage.qml" as "pages/UserRoleListPage.qml",
"resources/pages/UserRoleTablePage.qml" as "pages/UserRoleTablePage.qml",
"resources/qtquickcontrols2.conf" as "qtquickcontrol2.conf",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/qmldir",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/AdvoTracker.qmltypes",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/Button.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/CheckBox.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/MdiFont.js",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/IconLabel.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/Label.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/TextField.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/ScrollBar.qml",
},
);
fn main() {
advotracker_resource();
qml_register_type::<qml::AdvoTracker>(
CStr::from_bytes_with_nul(b"RustCode\0").unwrap(),
1,
0,
CStr::from_bytes_with_nul(b"AdvoTracker\0").unwrap(),
);
let mut engine = QmlEngine::new();
engine.load_file("qrc:/pages/advotracker.qml".into());
engine.exec();
}

View File

@@ -0,0 +1,56 @@
/* advotracker infrastructure.
*
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
* SPDX-License-Identifier: (0BSD or MIT)
*/
//#[macro_use] extern crate cstr;
extern crate qmetaobject;
use qmetaobject::*;
use std::ffi::CStr;
mod qml;
mod number_harm;
// make files available to the Qt resource system
qrc!(advotracker_resource,
"/" {
"resources/qt-project.org/imports/de/networkx/AdvoTracker/qmldir",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/AdvoTracker.qmltypes",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/Button.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/CheckBox.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/MdiFont.js",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/IconLabel.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/Label.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/TextField.qml",
"resources/qt-project.org/imports/de/networkx/AdvoTracker/ScrollBar.qml",
"resources/advotracker.qml" as "pages/AdvoTracker.qml",
"resources/images/customer_logo.jpg",
"resources/pages/LoginPage.qml" as "pages/LoginPage.qml",
"resources/pages/MaterialIconsPage.qml" as "pages/MaterialIconsPage.qml",
"resources/pages/NewUserPage.qml",
"resources/pages/PageNumberHarmList.qml" as "pages/PageNumberHarmList.qml",
"resources/pages/PageNumberHarm.qml" as "pages/PageNumberHarm.qml",
"resources/pages/PageUserDetail.qml" as "pages/PageUserDetail.qml",
"resources/pages/PageUserEdit.qml",
"resources/pages/PageUserList.qml",
"resources/pages/PageUserDetail.qml",
"resources/pages/LoginPage.qml" as "pages/LoginPage.qml",
"resources/pages/SearchToolBar.qml",
"resources/qtquickcontrols2.conf",
},
);
fn main() {
advotracker_resource();
qml_register_type::<qml::AdvoTracker>(
CStr::from_bytes_with_nul(b"RustCode\0").unwrap(),
1,
0,
CStr::from_bytes_with_nul(b"AdvoTracker\0").unwrap(),
);
let mut engine = QmlEngine::new();
engine.load_file("qrc:/pages/advotracker.qml".into());
engine.exec();
}

View File

@@ -0,0 +1 @@
// todo

View File

@@ -0,0 +1,83 @@
/* advotracker infrastructure.
*
* 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>
*
*/
use qmetaobject::*;
use std::collections::HashMap;
#[derive(Default, Clone)]
struct NumberHarmItem {
number_harm: String,
number_policyholder: String,
number_clerk_id: u32,
data_recorded: String,
completed: bool,
description: String,
}
impl NumberHarmItem {
// fn update_active_count(&mut self) {
// let ac = self.list.iter().filter(|i| !i.completed).count();
// if self.activeCount != ac {
// self.activeCount = ac;
// self.active_count_changed();
// }
// }
}
#[allow(non_snake_case)]
#[derive(Default, QObject)]
pub struct NumberHarm {
base: qt_base_class!(trait QAbstractListModel),
//base: qt_base_class!(trait SortFilterProxyModel),
count: qt_property!(i32; READ row_count NOTIFY count_changed),
count_changed: qt_signal!(),
list: Vec<NumberHarmItem>,
// activeCount: qt_property!(usize; NOTIFY active_count_changed),
// active_count_changed: qt_signal!(),
// setCompleted: qt_method!(fn(&mut self, item: usize, v: bool) -> bool),
// setDescription: qt_method!(fn(&mut self, item: usize, v: String) -> bool ),
// insert_rows: qt_method!(fn(&mut self, row: usize, count: usize) -> bool),
// remove_rows: qt_method!(fn(&mut self, row: usize, count: usize) -> bool),
// clearCompleted: qt_method!(fn(&mut self)),
// add: qt_method!(fn(&mut self, description: String)),
// remove: qt_method!(fn(&mut self, index: u64) -> bool),
// setAll: qt_method!(fn(&mut self, completed: bool)),
}
//impl QAbstractListModel for NumberHarm {
impl QSqlQueryModel for NumberHarm {
fn row_count(&self) -> i32 {
self.list.len() as i32
}
fn data(&self, index: QModelIndex, role: i32) -> QVariant {
let idx = index.row() as usize;
if idx < self.list.len() {
if role == USER_ROLE {
self.list[idx].completed.into()
} else if role == USER_ROLE + 1 {
QString::from(self.list[idx].description.clone()).into()
} else {
QVariant::default()
}
} else {
QVariant::default()
}
}
fn role_names(&self) -> HashMap<i32, QByteArray> {
let mut map = HashMap::new();
map.insert(USER_ROLE, "number_harm".into());
map.insert(USER_ROLE + 1, "number_policyholder".into());
map.insert(USER_ROLE + 2, "clerk_id".into());
map.insert(USER_ROLE + 1, "date_recorded".into());
map
}
}

View File

@@ -0,0 +1,7 @@
/// number_harm methods
/// List number_harm elements
mod list_number_harm;
/// Edit number_harm elements
mod edit_number_harm;

163
advotracker_qml/src/qml.rs Normal file
View File

@@ -0,0 +1,163 @@
/* 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>
*
*/
use qmetaobject::*;
#[derive(Default, Clone)]
struct AdvoTrackerItem {
completed: bool,
description: String,
}
#[allow(non_snake_case)]
#[derive(Default, QObject)]
pub struct AdvoTracker {
base: qt_base_class!(trait QAbstractListModel),
//base: qt_base_class!(trait QAbstractTableModel),
//base: qt_base_class!(trait QSqlQueryModel),
count: qt_property!(i32; READ row_count NOTIFY count_changed),
count_changed: qt_signal!(),
list: Vec<AdvoTrackerItem>,
// activeCount: qt_property!(usize; NOTIFY active_count_changed),
// active_count_changed: qt_signal!(),
// setCompleted: qt_method!(fn(&mut self, item: usize, v: bool) -> bool),
// setDescription: qt_method!(fn(&mut self, item: usize, v: String) -> bool ),
// insert_rows: qt_method!(fn(&mut self, row: usize, count: usize) -> bool),
// remove_rows: qt_method!(fn(&mut self, row: usize, count: usize) -> bool),
clearCompleted: qt_method!(fn(&mut self)),
// add: qt_method!(fn(&mut self, description: String)),
// remove: qt_method!(fn(&mut self, index: u64) -> bool),
// setAll: qt_method!(fn(&mut self, completed: bool)),
}
impl AdvoTracker {
// fn update_active_count(&mut self) {
// let ac = self.list.iter().filter(|i| !i.completed).count();
// if self.activeCount != ac {
// self.activeCount = ac;
// self.active_count_changed();
// }
// }
// #[allow(non_snake_case)]
// fn setCompleted(&mut self, item: usize, v: bool) -> bool {
// if item >= self.list.len() {
// return false;
// }
// self.list[item].completed = v;
// let idx = (self as &mut dyn QAbstractListModel).row_index(item as i32);
// (self as &mut dyn QAbstractListModel).data_changed(idx.clone(), idx);
// self.update_active_count();
// true
// }
#[allow(non_snake_case)]
fn setDescription(&mut self, item: usize, v: String) -> bool {
if item >= self.list.len() {
return false;
}
self.list[item].description = v;
let idx = (self as &mut dyn QAbstractListModel).row_index(item as i32);
(self as &mut dyn QAbstractListModel).data_changed(idx.clone(), idx);
true
}
// fn insert_rows(&mut self, row: usize, count: usize) -> bool {
// if count == 0 || row > self.list.len() {
// return false;
// }
// (self as &mut dyn QAbstractListModel)
// .begin_insert_rows(row as i32, (row + count - 1) as i32);
// for i in 0..count {
// self.list.insert(row + i, TodosItem::default());
// }
// (self as &mut dyn QAbstractListModel).end_insert_rows();
// self.activeCount += count;
// self.active_count_changed();
// self.count_changed();
// true
// }
// fn remove_rows(&mut self, row: usize, count: usize) -> bool {
// if count == 0 || row + count > self.list.len() {
// return false;
// }
// (self as &mut dyn QAbstractListModel)
// .begin_remove_rows(row as i32, (row + count - 1) as i32);
// self.list.drain(row..row + count);
// (self as &mut dyn QAbstractListModel).end_remove_rows();
// self.count_changed();
// self.update_active_count();
// true
// }
#[allow(non_snake_case)]
fn clearCompleted(&mut self) {
(self as &mut dyn QAbstractListModel).begin_reset_model();
self.list.retain(|i| !i.completed);
(self as &mut dyn QAbstractListModel).end_reset_model();
self.count_changed();
}
// fn add(&mut self, description: String) {
// let end = self.list.len();
// (self as &mut dyn QAbstractListModel).begin_insert_rows(end as i32, end as i32);
// self.list.insert(end, TodosItem { completed: false, description });
// (self as &mut dyn QAbstractListModel).end_insert_rows();
// self.activeCount += 1;
// self.active_count_changed();
// self.count_changed();
// }
// fn remove(&mut self, index: u64) -> bool {
// self.remove_rows(index as usize, 1)
// }
// #[allow(non_snake_case)]
// fn setAll(&mut self, completed: bool) {
// for i in &mut self.list {
// i.completed = completed;
// }
// let idx1 = (self as &mut dyn QAbstractListModel).row_index(0);
// let end = self.list.len() as i32;
// let idx2 = (self as &mut dyn QAbstractListModel).row_index(end - 1);
// (self as &mut dyn QAbstractListModel).data_changed(idx1, idx2);
// self.update_active_count();
// }
}
impl QAbstractListModel for AdvoTracker {
fn row_count(&self) -> i32 {
self.list.len() as i32
}
fn data(&self, index: QModelIndex, role: i32) -> QVariant {
let idx = index.row() as usize;
if idx < self.list.len() {
if role == USER_ROLE {
self.list[idx].completed.into()
} else if role == USER_ROLE + 1 {
QString::from(self.list[idx].description.clone()).into()
} else {
QVariant::default()
}
} else {
QVariant::default()
}
}
// fn role_names(&self) -> HashMap<i32, QByteArray> {
// let mut map = HashMap::new();
// map.insert(USER_ROLE, "completed".into());
// map.insert(USER_ROLE + 1, "description".into());
// map
// }
}