Commit 40a89158 authored by Karel Slaný's avatar Karel Slaný Committed by Martin Straka

Using a model to display gov service forms.

parent 975401db
/*
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import cz.nic.mobileDatovka 1.0
ScrollableListView {
id: root
delegateHeight: listItemHeight
delegate: Rectangle {
height: root.delegateHeight
width: parent.width
//color: datovkaPalette.base
Item {
anchors.fill: parent
anchors.margins: defaultMargin
Column {
anchors.right: parent.right
anchors.left: parent.left
spacing: formItemVerticalSpacing
anchors.verticalCenter: parent.verticalCenter
Text {
text: gsDescr
//color: headerColor
font.bold: true
width: parent.width
wrapMode: Text.Wrap
}
AccessibleTextField {
height: inputItemHeight
//maximumLength: 8
font.pointSize: defaultTextFont.font.pointSize
placeholderText: gsPlacehold
width: parent.width
InputLineMenu {
id: icox
inputTextControl: icoText
isPassword: false
}
onPressAndHold: {
if (settings.useExplicitClipboardOperations()) {
icox.implicitWidth = computeMenuWidth(icox)
icox.open()
}
}
}
}
} // Item
} // Rectangle
ScrollIndicator.vertical: ScrollIndicator {}
}
......@@ -25,6 +25,7 @@ import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import cz.nic.mobileDatovka 1.0
ScrollableListView {
id: root
......
......@@ -83,10 +83,67 @@ Item {
}
}
}
Flickable {
Pane {
id: formPane
anchors.top: headerBar.bottom
anchors.right: parent.right
anchors.left: parent.left
Column {
anchors.right: parent.right
anchors.left: parent.left
spacing: formItemVerticalSpacing
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Account:") + " " + acntName
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Request:") + " " + gsFullName
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: gsInstName
}
Text {
font.bold: false
text: " "
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Following information must be filled:")
}
Text {
font.bold: false
text: " "
}
}
}
GovFormList {
id: formList
z: 0
anchors.top: formPane.bottom
//anchors.bottom: parent.bottom
height: 400 // TODO -- remove
clip: true
spacing: 1
opacity: 1
visible: true
width: parent.width
interactive: true
model: govFormModel
}
Flickable { // TODO -- remove
id: flickable
z: 0
anchors.top: headerBar.bottom
anchors.top: formList.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
......@@ -98,38 +155,6 @@ Item {
anchors.right: parent.right
anchors.left: parent.left
spacing: formItemVerticalSpacing
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Account:") + " " + acntName
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Request:") + " " + gsFullName
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: gsInstName
}
Text {
font.bold: false
text: " "
}
AccessibleText {
font.bold: false
width: parent.width
wrapMode: Text.Wrap
text: qsTr("Following information must be filled:")
}
Text {
font.bold: false
text: " "
}
//---IČ field---
AccessibleText {
id: icoLabel
......
......@@ -117,6 +117,7 @@
<file>../qml/components/AccessibleTextField.qml</file>
<file>../qml/components/DataboxList.qml</file>
<file>../qml/components/FilterBar.qml</file>
<file>../qml/components/GovFormList.qml</file>
<file>../qml/components/GovServiceList.qml</file>
<file>../qml/components/InputLineMenu.qml</file>
<file>../qml/components/LogBar.qml</file>
......
......@@ -166,6 +166,7 @@ const struct QmlTypeEntry qmlComponents[] = {
{ "AccessibleTextField", 1, 0 },
{ "DataboxList", 1, 0 },
{ "FilterBar", 1, 0 },
{ "GovFormList", 1, 0 },
{ "GovServiceList", 1, 0 },
{ "InputLineMenu", 1, 0 },
{ "LogBar", 1, 0 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment