QDesignerFormEditorInterface Class
QDesignerFormEditorInterface 类允许您访问Qt Widgets Designer 的各种组件。更多
头文件: | #include <QDesignerFormEditorInterface> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Designer) target_link_libraries(mytarget PRIVATE Qt6::Designer) |
qmake: | QT += designer |
继承: | QObject |
公共函数
QDesignerFormEditorInterface(QObject *parent = nullptr) | |
virtual | ~QDesignerFormEditorInterface() |
QDesignerActionEditorInterface * | actionEditor() const |
QExtensionManager * | extensionManager() const |
QDesignerFormWindowManagerInterface * | formWindowManager() const |
QDesignerObjectInspectorInterface * | objectInspector() const |
QDesignerPropertyEditorInterface * | propertyEditor() const |
void | setActionEditor(QDesignerActionEditorInterface *actionEditor) |
void | setObjectInspector(QDesignerObjectInspectorInterface *objectInspector) |
void | setPropertyEditor(QDesignerPropertyEditorInterface *propertyEditor) |
void | setWidgetBox(QDesignerWidgetBoxInterface *widgetBox) |
QWidget * | topLevel() const |
QDesignerWidgetBoxInterface * | widgetBox() const |
详细说明
Qt Widgets Designer当前的 QDesignerFormEditorInterface 对象保存了所有Qt Widgets Designer 组件的信息:动作编辑器、对象检查器、属性编辑器、部件框以及扩展和窗体窗口管理器。QDesignerFormEditorInterface 包含一系列函数,为所有这些组件提供接口。它们通常用于查询(和操作)相应的组件。例如
auto *objectInspector = formEditor->objectInspector(); auto *manager = formEditor->formWindowManager(); objectInspector->setFormWindow(manager->formWindow(0));
QDesignerFormEditorInterface 不打算被直接实例化。QDesignerCustomWidgetInterface::initialize() 函数的参数提供了指向Qt Widgets Designer 的当前 QDesignerFormEditorInterface 对象(上例中为formEditor
)的指针。在实现自定义 widget 插件时,您必须子类化QDesignerCustomWidgetInterface ,以便向Qt Widgets Designer 暴露您的插件。
QDesignerFormEditorInterface 还提供了可以设置动作编辑器、属性编辑器、对象检查器和 widget 框的函数。这些函数只有在您想提供自己的自定义组件时才有用。
如果设计器嵌入到其他程序中,则可以提供自己的设置管理器。Qt Widgets Designer 的组件使用该管理器来存储/检索持久配置设置。默认管理器使用QSettings 作为后台。
最后,QDesignerFormEditorInterface 提供了topLevel() 函数,用于返回Qt Widgets Designer 的顶层部件。
另请参阅 QDesignerCustomWidgetInterface 。
成员函数文档
[explicit]
QDesignerFormEditorInterface::QDesignerFormEditorInterface(QObject *parent = nullptr)
用给定的parent 构造一个 QDesignerFormEditorInterface 对象。
[virtual noexcept]
QDesignerFormEditorInterface::~QDesignerFormEditorInterface()
销毁QDesignerFormEditorInterface 对象。
QDesignerActionEditorInterface *QDesignerFormEditorInterface::actionEditor() const
返回Qt Widgets Designer 动作编辑器的接口。
另请参阅 setActionEditor().
QExtensionManager *QDesignerFormEditorInterface::extensionManager() const
返回Qt Widgets Designer 扩展管理器的接口。
QDesignerFormWindowManagerInterface *QDesignerFormEditorInterface::formWindowManager() const
返回Qt Widgets Designer 表单窗口管理器的接口。
QDesignerObjectInspectorInterface *QDesignerFormEditorInterface::objectInspector() const
返回Qt Widgets Designer 对象检查器的接口。
另请参阅 setObjectInspector()。
QDesignerPropertyEditorInterface *QDesignerFormEditorInterface::propertyEditor() const
返回Qt Widgets Designer 的属性编辑器接口。
另请参阅 setPropertyEditor().
void QDesignerFormEditorInterface::setActionEditor(QDesignerActionEditorInterface *actionEditor)
将Qt Widgets Designer 的动作编辑器设置为指定的actionEditor 。
另请参阅 actionEditor() 。
void QDesignerFormEditorInterface::setObjectInspector(QDesignerObjectInspectorInterface *objectInspector)
将Qt Widgets Designer 的对象检查器设置为指定的objectInspector 。
另请参阅 objectInspector() 。
void QDesignerFormEditorInterface::setPropertyEditor(QDesignerPropertyEditorInterface *propertyEditor)
将Qt Widgets Designer 的属性编辑器设置为指定的propertyEditor 。
另请参阅 propertyEditor() 。
void QDesignerFormEditorInterface::setWidgetBox(QDesignerWidgetBoxInterface *widgetBox)
将Qt Widgets Designer 的 widget 框设置为指定的widgetBox 。
另请参阅 widgetBox() 。
QWidget *QDesignerFormEditorInterface::topLevel() const
返回Qt Widgets Designer 的顶级 widget。
QDesignerWidgetBoxInterface *QDesignerFormEditorInterface::widgetBox() const
返回Qt Widgets Designer widget 框的接口。
另请参阅 setWidgetBox().
© 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.