Sur cette page

QDesignerObjectInspectorInterface Class

La classe `QDesignerObjectInspectorInterface` vous permet de modifier l'élément actif de l'inspecteur d'objets d Qt Widgets Designer. En savoir plus...

En-tête : #include <QDesignerObjectInspectorInterface>
CMake : find_package(Qt6 REQUIRED COMPONENTS Designer)
target_link_libraries(mytarget PRIVATE Qt6::Designer)
qmake : QT += designer
Hérite de : QWidget

Fonctions publiques

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

Slots publics

virtual void setFormWindow(QDesignerFormWindowInterface *formWindow) = 0

Description détaillée

Vous pouvez utiliser l'interface QDesignerObjectInspectorInterface pour modifier la sélection actuelle de la fenêtre du formulaire. Par exemple, lors de l'implémentation d'un plugin de widget personnalisé :

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

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

Qt Widgets La classe QDesignerObjectInspectorInterface n'est pas destinée à être instanciée directement. Vous pouvez récupérer une interface vers l'inspecteur d'objets de l Qt Widgets Designer à l'aide de la fonction QDesignerFormEditorInterface::objectInspector(). Un pointeur vers l'objet QDesignerFormEditorInterface actuel du Designer (formEditor dans l'exemple ci-dessus) est fourni par le paramètre de la fonction QDesignerCustomWidgetInterface::initialize(). Lorsque vous implémentez un plugin de widget personnalisé, vous devez créer une sous-classe de QDesignerCustomWidgetInterface afin d'exposer votre plugin au Designer de Qt Widgets.

Cette interface fournit la fonction core() qui vous permet de récupérer un pointeur vers l’objet QDesignerFormEditorInterface actuel de l’éditeur d’ Qt Widgets, ainsi que la fonction setFormWindow() qui vous permet de modifier la sélection actuelle de la fenêtre de formulaire.

Voir également QDesignerFormEditorInterface et QDesignerFormWindowInterface.

Documentation sur les fonctions membres

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

Crée une interface d'inspecteur d'objets avec l'parent donné et la fenêtre spécifiée flags.

[override virtual noexcept] QDesignerObjectInspectorInterface::~QDesignerObjectInspectorInterface()

Supprime l'interface de l'inspecteur d'objets.

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

Qt Widgets Renvoie un pointeur vers l'objet « QDesignerFormEditorInterface » actuel de Designer.

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

Définit la fenêtre du formulaire actuellement sélectionnée sur « 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.