This is to give a default name to form controls by default, like <label> does to <input> and <textarea> in HTML. Had to add a “plain” version of the label, with neither the <u> tag used in rich text or the ‘&’ in the “regular” label, otherwise orca would spell out these symbols.
28 lines
529 B
QML
28 lines
529 B
QML
pragma ComponentBehavior: Bound
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
Label {
|
|
id: control
|
|
|
|
required property Item buddy
|
|
required property string mnemonic
|
|
|
|
Mnemonic.label: control.mnemonic
|
|
text: Mnemonic.richTextLabel
|
|
|
|
Shortcut {
|
|
sequence: control.Mnemonic.sequence
|
|
|
|
onActivated: function () {
|
|
control.buddy.forceActiveFocus();
|
|
}
|
|
}
|
|
|
|
Binding {
|
|
property: "Accessible.name"
|
|
target: control.buddy
|
|
value: control.Mnemonic.plainLabel
|
|
}
|
|
}
|