camper/src/MnemonicLabel.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
}
}