quickshell-web/modules_old/Quickshell/Retainable.json
2024-09-28 02:35:19 +03:00

76 lines
3.4 KiB
JSON

{
"name": "Retainable",
"module": "Quickshell",
"type": "class",
"super": {
"type": "qt",
"module": "qml.QtQml",
"name": "QtObject"
},
"description": "Attached object for types that can have delayed destruction.",
"details": "Retainable works as an attached property that allows objects to be\nkept around (retained) after they would normally be destroyed, which\nis especially useful for things like exit transitions.\n\nAn object that is retainable will have {{< qmltypelink type=\"local\" module=\"Quickshell\" name=\"Retainable\" mtype=\"\" mname=\"\" >}} as an attached property.\nAll retainable objects will say that they are retainable on their respective\ntypeinfo pages.\n\n{{< callout type=\"info\" >}}\n Working directly with {{< qmltypelink type=\"local\" module=\"Quickshell\" name=\"Retainable\" mtype=\"\" mname=\"\" >}} is often overly complicated and\nerror prone. For this reason {{< qmltypelink type=\"local\" module=\"Quickshell\" name=\"RetainableLock\" mtype=\"\" mname=\"\" >}} should\nusually be used instead.\n\n{{< /callout >}}",
"flags": [
"uncreatable"
],
"properties": {
"retained": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the object is currently in a retained state.\n",
"flags": [
"readonly"
]
}
},
"functions": [
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "forceUnlock",
"id": "forceUnlock",
"details": "Forcibly remove all locks, destroying the object.\n\n{{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"unlock\" >}} should usually be preferred.\n",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "lock",
"id": "lock",
"details": "Hold a lock on the object so it cannot be destroyed.\n\nA counter is used to ensure you can lock the object from multiple places\nand it will not be unlocked until the same number of unlocks as locks have occurred.\n\n{{< callout type=\"warning\" >}}\n It is easy to forget to unlock a locked object.\nDoing so will create what is effectively a memory leak.\n\nUsing {{< qmltypelink type=\"local\" module=\"Quickshell\" name=\"RetainableLock\" mtype=\"\" mname=\"\" >}} is recommended as it will help\navoid this scenario and make misuse more obvious.\n\n{{< /callout >}}",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "unlock",
"id": "unlock",
"details": "Remove a lock on the object. See {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"lock\" >}} for more information.\n",
"params": []
}
],
"signals": {
"aboutToDestroy": {
"name": "aboutToDestroy",
"details": "This signal is sent immediately before the object is destroyed.\nAt this point destruction cannot be interrupted.\n",
"params": []
},
"dropped": {
"name": "dropped",
"details": "This signal is sent when the object would normally be destroyed.\n\nIf all signal handlers return and no locks are in place, the object will be destroyed.\nIf at least one lock is present the object will be retained until all are removed.\n",
"params": []
}
},
"variants": {}
}