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.
2018-02-19 18:05:54 +01:00

51 lines
1.0 KiB
QML

import QtQuick 2.8
import QtQuick.Controls 2.1
Loader {
id: loader
property var paramType: null
property var value: null
source: {
var comp;
switch (loader.paramType.type) {
case "bool":
case "Bool":
comp = "Bool";
break;
case "String":
comp = "String";
break;
case "Int":
comp = "Int";
break;
case "Double":
comp = "Double";
break;
default:
print("unhandled param type:", paramType.type)
}
return Qt.resolvedUrl(comp + "ParamDelegate.qml")
}
onStatusChanged: {
if (status == Loader.Ready) {
loader.item.value = root.value
}
}
Binding {
target: loader.item
when: loader.item
property: "paramType"
value: loader.paramType
}
Binding {
target: loader
when: loader.item
property: "value"
value: loader.item.value
}
}