本页内容

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 并非 intended 用于直接实例化。指向Qt Widgets Designer 当前 QDesignerFormEditorInterface 对象的指针(如上例中的formEditor )由QDesignerCustomWidgetInterface::initialize() 函数的参数提供。在实现自定义小部件插件时,必须继承QDesignerCustomWidgetInterface 以将您的插件暴露给Qt Widgets Designer 。

QDesignerFormEditorInterface 还提供了用于设置操作编辑器、属性编辑器、对象检查器和控件框的函数。这些函数仅在您希望提供自定义组件时才有用。

如果设计器嵌入在另一个程序中,可以提供自己的设置管理器。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 的控件框设置为指定的widgetBox 。

另请参阅 widgetBox()。

QWidget *QDesignerFormEditorInterface::topLevel() const

返回Qt Widgets Designer 的顶级控件。

QDesignerWidgetBoxInterface *QDesignerFormEditorInterface::widgetBox() const

返回指向Qt Widgets Designer 控件框的接口。

另请参阅 setWidgetBox()。

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