quickshell-web/modules/Quickshell/BoundComponent.json

74 lines
2.4 KiB
JSON
Raw Normal View History

2024-09-27 23:35:19 +00:00
{
"name": "BoundComponent",
"module": "Quickshell",
"type": "class",
"super": {
"type": "qt",
"module": "qml.QtQuick",
"name": "Item"
},
"description": "Component loader that allows setting initial properties.",
"details": "Component loader that allows setting initial properties, primarily useful for\nescaping cyclic dependency errors.\n\nProperties defined on the BoundComponent will be applied to its loaded component,\nincluding required properties, and will remain reactive. Functions created with\nthe names of signal handlers will also be attached to signals of the loaded component.\n\n```qml {filename=\"MyComponent.qml\"}\nMouseArea {\n required property color color;\n width: 100\n height: 100\n\n Rectangle {\n anchors.fill: parent\n color: parent.color\n }\n}\n```\n\n```qml\nBoundComponent {\n source: \"MyComponent.qml\"\n\n // this is the same as assigning to `color` on MyComponent if loaded normally.\n property color color: \"red\";\n\n // this will be triggered when the `clicked` signal from the MouseArea is sent.\n function onClicked() {\n color = \"blue\";\n }\n}\n```\n",
"properties": {
"implicitHeight": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": null,
"flags": [
"readonly"
]
},
"implicitWidth": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": null,
"flags": [
"readonly"
]
},
"item": {
"type": {
"type": "qt",
"module": "qml.QtQml",
"name": "QtObject"
},
"details": "The loaded component. Will be null until it has finished loading.\n",
"flags": [
"readonly"
]
},
"bindValues": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If property values should be bound after they are initially set. Defaults to `true`.\n"
},
"source": {
"type": {
"type": "qt",
"module": "qml",
"name": "string"
},
"details": "The source to load, as a Url.\n"
},
"sourceComponent": {
"type": {
"type": "qt",
"module": "qml.QtQml",
"name": "Component"
},
"details": "The source to load, as a Component.\n"
}
},
"functions": [],
"signals": {},
"variants": {}
}