From 8d57bfb1aef3b71557bc408154ee028751fd688e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 14 Jun 2021 19:09:53 +0200 Subject: First commit There was history before but now there is no more. --- Fields/Bool.qml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Fields/Bool.qml (limited to 'Fields/Bool.qml') diff --git a/Fields/Bool.qml b/Fields/Bool.qml new file mode 100644 index 0000000..ccb0758 --- /dev/null +++ b/Fields/Bool.qml @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: Unlicense + +import QtQuick 2.12 +import QtQuick.Controls 2.13 + +Row { + id: control + width: parent.width + + property var definition + property alias value: input.checked + + Keys.onPressed: { + if (event.text === definition.key) { + value = !value + event.accepted = true + } + } + function set(val) { value = val || false } + + CheckBox { + id: input + focusPolicy: Qt.NoFocus + padding: 0 + font.capitalization: Font.SmallCaps + } +} -- cgit v1.3