本页内容

QAbstractObjectRegistryRef Class

QAbstractObjectRegistryRef 类是所有Qt Qml 设计支持对象引用类的基类。更多内容...

头文件: #include <QAbstractObjectRegistryRef>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlDesignSupport)
target_link_libraries(mytarget PRIVATE Qt6::QmlDesignSupport)
qmake: QT += qmldesignsupport
自: Qt 6.12
在 QML 中: AbstractObjectRegistryRef
继承自: QObject
被继承类:

QMultiObjectRegistryRef 以及QObjectRegistryRef

属性

  • key : QString

公共函数

QString key() const
void setKey(const QString &key)

信号

void keyChanged(const QString &key)

重新实现的受保护函数

virtual bool event(QEvent *event) override

详细说明

该类无法单独实例化,您必须使用以下派生类之一:QObjectRegistryRef 或QMultiObjectRegistryRef

如果多个对象使用相同的键进行注册,请使用派生类QMultiObjectRegistryRef 。通常这种情况发生在由模型实例化的委托对象被注册时。如果您确定该键仅用于注册单个对象,建议使用派生类QObjectRegistryRef 。

属性文档

key : QString

该属性包含此引用所指向的已注册对象的键。

访问函数:

QString key() const
void setKey(const QString &key)

通知器信号:

void keyChanged(const QString &key)

另请参阅 ObjectRegistry 。

成员函数文档

[override virtual protected] bool QAbstractObjectRegistryRef::event(QEvent *event)

重写了:QObject::event(QEvent *e)。

© 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.