// A row whose trailing control is a masked field that can be emptied on demand. // // PasswordRow already reports every keystroke, which is what comparing two // entries as they are typed needs. What it cannot do is forget: its field is // private, so a form that closed left the typed password sitting in a hidden // TextInput for the rest of the session. // // This exposes `clear()` so the page that owns a form can empty it when the // form succeeds or closes, which is the only difference between the two. import QtQuick import qs.config SettingRow { id: root property string placeholder: "Password" property bool enabled: true signal changed(value: string) signal accepted controlWidth: 220 function clear(): void { field.clear(); root.changed(""); } PasswordField { id: field anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: root.controlWidth enabled: root.enabled opacity: root.enabled ? 1 : 0.5 placeholder: root.placeholder onTextChanged: root.changed(field.text) onAccepted: root.accepted() } }