QDesignerObjectInspectorInterface Class
QDesignerObjectInspectorInterface 类允许您更改《Qt Widgets Designer 》中对象检查器的焦点。更多内容...
| 头文件: | #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() override |
| virtual QDesignerFormEditorInterface * | core() const |
公共槽
| virtual void | setFormWindow(QDesignerFormWindowInterface *formWindow) = 0 |
详细说明
您可以使用 QDesignerObjectInspectorInterface 来更改当前表单窗口的选定项。例如,在实现自定义控件插件时:
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 )的指针。在实现自定义小部件插件时,您必须继承QDesignerCustomWidgetInterface 类,以便将您的插件暴露给Qt Widgets Designer 。
该接口提供了core() 函数,可用于获取指向Qt Widgets Designer 当前QDesignerFormEditorInterface 对象的指针;还提供了setFormWindow() 函数,可用于更改当前表单窗口的选择。
另请参阅 QDesignerFormEditorInterface 和QDesignerFormWindowInterface 。
成员函数文档
[explicit] QDesignerObjectInspectorInterface::QDesignerObjectInspectorInterface(QWidget *parent, Qt::WindowFlags flags = {})
根据给定的parent 和指定的窗口flags ,构建一个对象检查器界面。
[override virtual noexcept] QDesignerObjectInspectorInterface::~QDesignerObjectInspectorInterface()
销毁对象检查器界面。
[virtual] QDesignerFormEditorInterface *QDesignerObjectInspectorInterface::core() const
返回指向Qt Widgets Designer 当前QDesignerFormEditorInterface 对象的指针。
[pure virtual slot] void QDesignerObjectInspectorInterface::setFormWindow(QDesignerFormWindowInterface *formWindow)
将当前选中的表单窗口设置为formWindow 。
© 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.