Thank you for your direction Erwin Soekianto! I feel like I'm making good progress on this but I have another question. Here's what I have so far:
I edited the properties in appinfo.json and QuickReportApp.qml instead of appschema.json. I'm not sure if the appinfo.json portion is needed or what it is used for, or if I still need to put something in the appschema.json, but I figured out that if you add a property to app.settings it gets saved when the app is closed.
appinfo.json
"userEmail": "",
"userFullName": "",
"userPhone": "",
QuickReportApp.qml
property string userFullName: app.settings.value("userFullName", "")
property string userPhone: app.settings.value("userPhone", "")
property string userEmail: app.settings.value("userEmail", "")
In the SettingsPage.qml, I created 3 new rectangles and added 3 new controls (boxes for the user to save their info):
Text{
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Name")
fontSizeMode: Text.Fit
font.pixelSize: app.textFontSize
font.family: app.customTitleFont.name
color: app.subtitleColor
}
NewControls.TextField {
id: textFullName
text: app.userFullName
onTextChanged: {
app.settings.setValue("userFullName", textFullName.text)
}
}
Text{
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Phone Number")
fontSizeMode: Text.Fit
font.pixelSize: app.textFontSize
font.family: app.customTitleFont.name
color: app.subtitleColor
}
NewControls.TextField {
id: textPhone
text: app.userPhone
validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
inputMask: "000-000-0000"
inputMethodHints: Qt.ImhDialableCharactersOnly
onTextChanged: {
app.settings.setValue("userPhone", textPhone.text)
}
}
Text{
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Email")
fontSizeMode: Text.Fit
font.pixelSize: app.textFontSize
font.family: app.customTitleFont.name
color: app.subtitleColor
}
NewControls.TextField {
id: textEmail
text: app.userEmail
validator: RegExpValidator { regExp: /^[A-Z][A-Z0-9._%+-]*@[A-Z0-9.-]+\.[A-Z]{2,4}$/i }
inputMethodHints: Qt.ImhEmailCharactersOnly
onTextChanged: {
app.settings.setValue("userEmail", textEmail.text)
}
}
Then to force the Add Details page to populate with the saved settings, I edited the 'property var defaultValue' in AttributesPage.qml
property var defaultValue : fieldName == "email" ? app.userEmail : fieldName == "Phone" ? app.userPhone : fieldName == "Name" ? app.userFullName : hasPrototype ? featureTypes[pickListIndex].templates[0].prototype[modelData["name"]] : fieldType == Enums.FieldTypeText ? "" : null
Then the last piece of the puzzle is how to I force the user to fill out the settings when they first download the app?