quickshell-web/modules/Quickshell/Retainable.json

76 lines
3 KiB
JSON
Raw Normal View History

2024-09-27 23:35:19 +00:00
{
"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 TYPE99MQS_Quickshell99NRetainable99TYPE as an attached property.\nAll retainable objects will say that they are retainable on their respective\ntypeinfo pages.\n\n> [!NOTE] Working directly with TYPE99MQS_Quickshell99NRetainable99TYPE is often overly complicated and\n> error prone. For this reason TYPE99MQS_Quickshell99NRetainableLock99TYPE should\n> usually be used instead.\n",
"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\nTYPE99Vunlock99Tfunc99TYPE 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> [!WARNING] It is easy to forget to unlock a locked object.\n> Doing so will create what is effectively a memory leak.\n>\n> Using TYPE99MQS_Quickshell99NRetainableLock99TYPE is recommended as it will help\n> avoid this scenario and make misuse more obvious.\n",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "unlock",
"id": "unlock",
"details": "Remove a lock on the object. See TYPE99Vlock99Tfunc99TYPE for more information.\n",
"params": []
}
],
"signals": {
"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": []
},
"aboutToDestroy": {
"name": "aboutToDestroy",
"details": "This signal is sent immediately before the object is destroyed.\nAt this point destruction cannot be interrupted.\n",
"params": []
}
},
"variants": {}
}