ObjectRegistryRef QML Type
Dieser Typ dient zum Zugriff auf ein Objekt, das mit dem Typ „ ObjectRegistry “ registriert ist. Mehr…
| Import Statement: | import QtQml.DesignSupport |
| Since: | Qt 6.12 |
| In C++: | QObjectRegistryRef |
| Inherits: |
- Liste aller Mitglieder, einschließlich geerbter Mitglieder
- „ObjectRegistryRef“ ist Teil der „Qt Qml Design Support QML Types“.
Eigenschaften
- object : QtObject
Ausführliche Beschreibung
Anwendungsbeispiel:
// 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")
}
}
}Siehe auch ObjectRegistry und AbstractObjectRegistryRef::key.
Dokumentation zu den Eigenschaften
object : QtObject [read-only]
Diese Eigenschaft gibt das Objekt an, auf das diese Instanz verweist.
Wenn mehrere Objekte unter demselben Schlüssel registriert sind, verweist diese Instanz auf ein nicht näher bezeichnetes Objekt aus dieser Gruppe. Verwenden Sie in diesem Fall QMultiObjectRegistryRef.
Siehe auch „ ObjectRegistry “ und „ 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.