ObjectRegistryRef QML Type
Questo tipo viene utilizzato per accedere a un oggetto registrato con un tip ObjectRegistry. Per saperne di più...
| Import Statement: | import QtQml.DesignSupport |
| Since: | Qt 6.12 |
| In C++: | QObjectRegistryRef |
| Inherits: |
- Elenco di tutti i membri, compresi quelli ereditati
- ObjectRegistryRef fa parte dei tipi QML di supporto alla progettazione diQt Qml .
Proprietà
- object : QtObject
Descrizione dettagliata
Esempio di utilizzo:
// Register object in a QML file
MouseArea {
ObjectRegistry.key: "MyMouseArea"
}
// In another QML file, refer to the registered object
ObjectRegistryRef {
id: mouseAreaRef
key: "MyMouseArea"
Connections {
target: mouseAreaRef.object
function onClicked(mouse) {
console.log("Mouse clicked")
}
}
}Vedi anche ObjectRegistry e AbstractObjectRegistryRef::key.
Documentazione delle proprietà
object : QtObject [read-only]
Questa proprietà specifica l'oggetto a cui fa riferimento questa istanza.
Se più oggetti sono registrati con la stessa chiave, questa istanza fa riferimento a un oggetto non specificato appartenente a quel gruppo. In questo caso, utilizzare QMultiObjectRegistryRef.
Vedi anche ObjectRegistry e AbstractObjectRegistryRef::key.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.