advotracker_qml: advotracker variant with Qt/Qml GUI
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
341
advotracker_qml/resources/pages/PolicyPage-save.qml
Executable file
341
advotracker_qml/resources/pages/PolicyPage-save.qml
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user