import QtQuick import QtQuick.Layouts import qs.Components import qs.Config Item { id: root required property string name required property var object required property string setting Layout.fillWidth: true Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2 RowLayout { id: row anchors.left: parent.left anchors.margins: Appearance.padding.small anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter CustomText { id: text Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.fillWidth: true font.pointSize: Appearance.font.size.larger text: root.name } CustomSwitch { id: cswitch Layout.alignment: Qt.AlignRight | Qt.AlignVCenter checked: root.object[root.setting] onToggled: { root.object[root.setting] = checked; Config.save(); } } } }