MVC Architecture Demo App
import Felgo 4.0
import QtQuick 2.0
AppPage {
id: page
title: viewHelper.formatTitle(todoData)
rightBarItem: ActivityIndicatorBarItem {
id: activityBarItem
visible: dataModel.isBusy && !dataModel.isStoringTodos
showItem: showItemAlways
}
property int todoId: 0
property var todoData: dataModel.todoDetails[todoId]
onTodoIdChanged: {
logic.fetchTodoDetails(todoId)
}
Column {
y: spacing
width: parent.width - 2 * spacing
anchors.horizontalCenter: parent.horizontalCenter
spacing: dp(Theme.navigationBar.defaultBarItemPadding)
visible: !noDataMessage.visible
Repeater {
enabled: parent.visible
model: !!todoData ? Object.keys(todoData) : undefined
AppText {
property string propName: modelData
property string value: todoData[propName]
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
height: implicitHeight
text: "<strong>"+propName+":</strong> "+value
wrapMode: AppText.WrapAtWordBoundaryOrAnywhere
}
}
}
AppText {
id: noDataMessage
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Todo data not available. Please check your internet connection.")
width: parent.width
horizontalAlignment: Qt.AlignHCenter