ObjectRegistryRef QML Type
이 타입은 ` ObjectRegistry ` 타입으로 등록된 객체에 접근하는 데 사용됩니다. 더 보기...
| Import Statement: | import QtQml.DesignSupport |
| Since: | Qt 6.12 |
| In C++: | QObjectRegistryRef |
| Inherits: |
- 상속된 멤버를 포함한 모든 멤버 목록
- ObjectRegistryRef는 Qt Qml 디자인 지원 QML 유형의 일부입니다.
속성
- object : QtObject
상세 설명
사용 예:
// 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")
}
}
}ObjectRegistry 및 AbstractObjectRegistryRef::key도 참조하십시오 .
속성 설명서
object : QtObject [read-only]
이 속성은 이 인스턴스가 참조하는 객체를 지정합니다.
동일한 키로 여러 객체가 등록된 경우, 이 인스턴스는 해당 그룹 내의 지정되지 않은 객체를 참조합니다. 이 경우 QMultiObjectRegistryRef 를 사용하십시오.
ObjectRegistry 및 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.