This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/mea/ui/actiondelegates/ActionDelegateBool.qml
2018-03-09 10:20:28 +01:00

32 lines
887 B
QML

import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
ActionDelegateBase {
id: root
height: rowLayout.implicitHeight
RowLayout {
id: rowLayout
anchors { left: parent.left; right: parent.right; margins: app.margins }
spacing: app.margins
Label {
Layout.fillWidth: true
verticalAlignment: Text.AlignVCenter
text: root.actionType ? root.actionType.displayName : ""
}
Switch {
position: root.actionState ? root.actionState : 0
onClicked: {
var params = [];
var param1 = new Object();
param1["paramTypeId"] = root.actionType.paramTypes.get(0).id;
param1["value"] = checked;
params.push(param1)
root.executeAction(params)
}
}
}
}