57 lines
2.1 KiB
JSON
57 lines
2.1 KiB
JSON
|
{
|
||
|
"name": "Variants",
|
||
|
"module": "Quickshell",
|
||
|
"type": "class",
|
||
|
"super": {
|
||
|
"type": "local",
|
||
|
"module": "Quickshell",
|
||
|
"name": "Reloadable"
|
||
|
},
|
||
|
"description": "Creates instances of a component based on a given model.",
|
||
|
"details": "Creates and destroys instances of the given component when the given property changes.\n\n`Variants` is similar to TYPE99MQT_qml_QtQuick99NRepeater99TYPE except it is for *non TYPE99MQT_qml_QtQuick99NItem99TYPE* objects, and acts as\na reload scope.\n\nEach non duplicate value passed to TYPE99Vmodel99Tprop99TYPE will create a new instance of\nTYPE99Vdelegate99Tprop99TYPE with a `modelData` property set to that value.\n\nSee TYPE99MQS_Quickshell99NQuickshell99Vscreens99Tprop99TYPE for an example of using `Variants` to create copies of a window per\nscreen.\n\n> [!WARNING] BUG: Variants currently fails to reload children if the variant set is changed as\n> it is instantiated. (usually due to a mutation during variant creation)\n",
|
||
|
"properties": {
|
||
|
"delegate": {
|
||
|
"type": {
|
||
|
"type": "qt",
|
||
|
"module": "qml.QtQml",
|
||
|
"name": "Component"
|
||
|
},
|
||
|
"details": "The component to create instances of.\n\nThe delegate should define a `modelData` property that will be popuplated with a value\nfrom the TYPE99Vmodel99Tprop99TYPE.\n",
|
||
|
"flags": [
|
||
|
"default"
|
||
|
]
|
||
|
},
|
||
|
"instances": {
|
||
|
"type": {
|
||
|
"type": "qt",
|
||
|
"module": "qml",
|
||
|
"name": "list",
|
||
|
"of": {
|
||
|
"type": "qt",
|
||
|
"module": "qml.QtQml",
|
||
|
"name": "QtObject"
|
||
|
}
|
||
|
},
|
||
|
"details": "Current instances of the delegate.\n",
|
||
|
"flags": [
|
||
|
"readonly"
|
||
|
]
|
||
|
},
|
||
|
"model": {
|
||
|
"type": {
|
||
|
"type": "qt",
|
||
|
"module": "qml",
|
||
|
"name": "list",
|
||
|
"of": {
|
||
|
"type": "qt",
|
||
|
"module": "qml",
|
||
|
"name": "variant"
|
||
|
}
|
||
|
},
|
||
|
"details": "The list of sets of properties to create instances with.\nEach set creates an instance of the component, which are updated when the input sets update.\n"
|
||
|
}
|
||
|
},
|
||
|
"functions": [],
|
||
|
"signals": {},
|
||
|
"variants": {}
|
||
|
}
|