QDesignerDynamicPropertySheetExtension Class

QDesignerDynamicPropertySheetExtension 类允许您在Qt Widgets Designer 的属性编辑器中操作部件的动态属性。更多

Header: #include <QDesignerDynamicPropertySheetExtension>
CMake: find_package(Qt6 REQUIRED COMPONENTS Designer)
target_link_libraries(mytarget PRIVATE Qt6::Designer)
qmake: QT += designer

公共函数

virtual ~QDesignerDynamicPropertySheetExtension()
virtual int addDynamicProperty(const QString &propertyName, const QVariant &value) = 0
virtual bool canAddDynamicProperty(const QString &propertyName) const = 0
virtual bool dynamicPropertiesAllowed() const = 0
virtual bool isDynamicProperty(int index) const = 0
virtual bool removeDynamicProperty(int index) = 0

详细说明

另请参见 QDesignerPropertySheetExtensionDynamic Properties

成员函数文档

[virtual constexpr noexcept] QDesignerDynamicPropertySheetExtension::~QDesignerDynamicPropertySheetExtension()

销毁动态属性表扩展。

[pure virtual] int QDesignerDynamicPropertySheetExtension::addDynamicProperty(const QString &propertyName, const QVariant &value)

添加名为propertyName 的动态属性,并将其值设置为value 。如果添加成功,则返回属性索引;否则返回 -1 表示添加失败。

[pure virtual] bool QDesignerDynamicPropertySheetExtension::canAddDynamicProperty(const QString &propertyName) const

如果propertyName 是一个有效、唯一的动态属性名称,则返回 true;否则返回 false。

[pure virtual] bool QDesignerDynamicPropertySheetExtension::dynamicPropertiesAllowed() const

如果 widget 支持动态属性,则返回 true;否则返回 false。

[pure virtual] bool QDesignerDynamicPropertySheetExtension::isDynamicProperty(int index) const

如果index 上的属性是动态属性,则返回 true;否则返回 false。

[pure virtual] bool QDesignerDynamicPropertySheetExtension::removeDynamicProperty(int index)

删除index 上的动态属性。如果操作成功,则返回 true;否则返回 false。

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