QDesignerObjectInspectorInterface Class

QDesignerObjectInspectorInterface 类允许您更改Qt Widgets Designer 对象检查器的焦点。更多

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

公共函数

QDesignerObjectInspectorInterface(QWidget *parent, Qt::WindowFlags flags = {})
virtual ~QDesignerObjectInspectorInterface()
virtual QDesignerFormEditorInterface *core() const

公共插槽

virtual void setFormWindow(QDesignerFormWindowInterface *formWindow) = 0

详细说明

您可以使用 QDesignerObjectInspectorInterface 来更改当前窗体窗口的选择。例如,在实现自定义 widget 插件时:

        auto *objectInspector = formEditor->objectInspector();
        auto *manager = formEditor->formWindowManager();

        objectInspector->setFormWindow(manager->formWindow(0));

QDesignerObjectInspectorInterface 类不打算直接实例化。您可以使用QDesignerFormEditorInterface::objectInspector() 函数获取Qt Widgets Designer 的对象检查器接口。QDesignerCustomWidgetInterface::initialize() 函数的参数提供了指向Qt Widgets Designer 当前QDesignerFormEditorInterface 对象(上例中为formEditor )的指针。在实现自定义 widget 插件时,必须子类化QDesignerCustomWidgetInterface ,以便将插件公开给Qt Widgets Designer

该接口提供了core() 函数和setFormWindow() 函数,前者可用于获取指向Qt Widgets Designer 当前QDesignerFormEditorInterface 对象的指针,后者可用于更改当前窗体窗口选择。

另请参阅 QDesignerFormEditorInterfaceQDesignerFormWindowInterface

成员函数文档

[explicit] QDesignerObjectInspectorInterface::QDesignerObjectInspectorInterface(QWidget *parent, Qt::WindowFlags flags = {})

使用给定的parent 和指定的窗口flags 构建对象检查器界面。

[virtual noexcept] QDesignerObjectInspectorInterface::~QDesignerObjectInspectorInterface()

销毁对象检查器界面。

[virtual] QDesignerFormEditorInterface *QDesignerObjectInspectorInterface::core() const

返回Qt Widgets Designer 当前QDesignerFormEditorInterface 对象的指针。

[pure virtual slot] void QDesignerObjectInspectorInterface::setFormWindow(QDesignerFormWindowInterface *formWindow)

将当前选定的表格窗口设置为formWindow

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