Hi,
I have an input form and TextFieldRow component fits perfectly into it, but I didn’t find any way to replace TextField with Combo for some fields. Is it possible? If I place combo after Repeater, like in snippet below, it looks shifted having its own padding and other alignment parameters:
Column {
width: parent.width
Repeater {
model: Object.keys(profileData)
TextFieldRow {
label: modelData.replace("_", " ")
textItem.wrapMode: Text.NoWrap
textItem.font.capitalization: Font.Capitalize
textFieldItem.readOnly: Object.keys(profileData)[index] === "email"
textFieldItem.inputMethodHints: Qt.ImhNoPredictiveText
textFieldItem.inputMode: modelData === "password"?AppTextField.inputModePassword:(modelData === "email"?AppTextField.inputModeEmail:AppTextField.inputModeDefault)
visible: modelData !== "id"
value: profileData[modelData]
textFieldItem.onAccepted: {
logic.storeProfileData(profileId, Object.keys(profileData)[index], text)
page.forceActiveFocus()
}
}
}
// sex is a combobox
Row {
AppText {
wrapMode: Text.NoWrap
text: qsTr("Sex")
}
ComboBox {
model: [qsTr("Not known"), qsTr("Male"), qsTr("Female")]
currentIndex: profileData["sex"]
onActivated: {
logic.storeProfileData(profileId, "sex", currentIndex)
page.forceActiveFocus()
}
}
}
}
Setting input mode of the text field gives an error “Unable to assign [undefined] to int”. What namespace should I use for input modes?