このページでは

QDesignerFormWindowManagerInterface Class

QDesignerFormWindowManagerInterface クラスを使用すると、Qt Widgets Designer 内のフォームウィンドウのコレクションを操作したり、Qt Widgets Designer のフォーム編集操作を制御したりすることができます。詳細...

ヘッダー: #include <QDesignerFormWindowManagerInterface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Designer)
target_link_libraries(mytarget PRIVATE Qt6::Designer)
qmake: QT += designer
継承元: QObject

パブリック型

enum Action { CutAction, CopyAction, PasteAction, DeleteAction, SelectAllAction, …, FormWindowSettingsDialogAction }
enum ActionGroup { StyledPreviewActionGroup }

パブリック関数

QDesignerFormWindowManagerInterface(QObject *parent = nullptr)
virtual ~QDesignerFormWindowManagerInterface() override
virtual QAction *action(QDesignerFormWindowManagerInterface::Action action) const = 0
virtual QActionGroup *actionGroup(QDesignerFormWindowManagerInterface::ActionGroup actionGroup) const = 0
virtual QDesignerFormWindowInterface *activeFormWindow() const = 0
virtual QDesignerFormEditorInterface *core() const = 0
virtual QDesignerFormWindowInterface *createFormWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()) = 0
virtual QPixmap createPreviewPixmap() const = 0
virtual QDesignerFormWindowInterface *formWindow(int index) const = 0
virtual int formWindowCount() const = 0

パブリックスロット

virtual void addFormWindow(QDesignerFormWindowInterface *formWindow) = 0
virtual void closeAllPreviews() = 0
virtual void removeFormWindow(QDesignerFormWindowInterface *formWindow) = 0
virtual void setActiveFormWindow(QDesignerFormWindowInterface *formWindow) = 0
virtual void showPluginDialog() = 0
virtual void showPreview() = 0

シグナル

void activeFormWindowChanged(QDesignerFormWindowInterface *formWindow)
void formWindowAdded(QDesignerFormWindowInterface *formWindow)
void formWindowRemoved(QDesignerFormWindowInterface *formWindow)
void formWindowSettingsChanged(QDesignerFormWindowInterface *formWindow)

詳細な説明

QDesignerFormWindowManagerInterface は、直接インスタンス化されることを意図していません。Qt Widgets Designer は、フォームウィンドウマネージャーを使用して、そのワークスペース内のさまざまなフォームウィンドウを制御します。QDesignerFormEditorInterface::formWindowManager() 関数を使用すると、Qt Widgets Designer のフォームウィンドウマネージャーへのインターフェースを取得できます。例:

        auto *manager = formEditor->formWindowManager();
        auto *formWindow = manager->formWindow(0);

        manager->setActiveFormWindow(formWindow);

カスタムウィジェットプラグインを実装する場合、Qt Widgets Designer の現在のQDesignerFormEditorInterface オブジェクト(上記の例ではformEditor )へのポインタは、QDesignerCustomWidgetInterface::initialize()関数のパラメータとして提供されます。プラグインをQt Widgets Designer に公開するには、QDesignerCustomWidgetInterface をサブクラス化する必要があります。

フォームウィンドウマネージャのインターフェースには、createFormWindow() 関数が用意されています。この関数を使用すると、新しいフォームウィンドウを作成し、addFormWindow() スロットを通じて、マネージャが管理するフォームウィンドウのコレクションに追加することができます。 また、マネージャが現在管理しているフォームウィンドウの数を返すformWindowCount()関数、指定されたインデックスに関連付けられたフォームウィンドウを返すformWindow()関数、および現在選択されているフォームウィンドウを返すactiveFormWindow()関数も提供しています。removeFormWindow() スロットを使用すると、マネージャーが管理しなければならないフォームウィンドウの数を減らすことができ、setActiveFormWindow() スロットを使用すると、Qt Widgets Designer のワークスペース内でフォームウィンドウのフォーカスを変更することができます。

さらに、QDesignerFormWindowManagerInterfaceには、Qt Widgets Designer のフォーム編集アクションに介入して制御することを可能にする一連の関数が含まれています。これらの関数はすべて元のアクションを返すため、介入後もその関数をさらに伝播させることが可能です。

最後に、このインターフェースは、フォームウィンドウが追加されたとき、現在選択されているフォームウィンドウが変更されたとき、またはフォームウィンドウが削除されたときに、それぞれ発火する3つのシグナルを提供します。すべてのシグナルは、対象となるフォームウィンドウをパラメータとして持ちます。

QDesignerFormEditorInterface およびQDesignerFormWindowInterfaceも参照してください 。

メンバ型のドキュメント

enum QDesignerFormWindowManagerInterface::Action

Qt Widgets Designer のアクションを指定します。

定数値説明
QDesignerFormWindowManagerInterface::CutAction100クリップボードの切り取り
QDesignerFormWindowManagerInterface::CopyAction101クリップボードの切り取りクリップボードのコピー
QDesignerFormWindowManagerInterface::PasteAction102クリップボードへの貼り付け
QDesignerFormWindowManagerInterface::DeleteAction103クリップボードの削除
QDesignerFormWindowManagerInterface::SelectAllAction104すべて選択
QDesignerFormWindowManagerInterface::LowerAction200現在のウィジェットを下に動かす
QDesignerFormWindowManagerInterface::RaiseAction201現在のウィジェットを上に移動
QDesignerFormWindowManagerInterface::UndoAction300元に戻す
QDesignerFormWindowManagerInterface::RedoAction301やり直し
QDesignerFormWindowManagerInterface::HorizontalLayoutAction400レイアウトに使用するQHBoxLayout
QDesignerFormWindowManagerInterface::VerticalLayoutAction401これを使用してレイアウトQVBoxLayout
QDesignerFormWindowManagerInterface::SplitHorizontalAction402水平方向に配置QSplitter
QDesignerFormWindowManagerInterface::SplitVerticalAction403縦方向に配置QSplitter
QDesignerFormWindowManagerInterface::GridLayoutAction404以下を使用してレイアウトQGridLayout
QDesignerFormWindowManagerInterface::FormLayoutAction405以下を使用してレイアウトするQFormLayout
QDesignerFormWindowManagerInterface::BreakLayoutAction406既存のレイアウトを解除
QDesignerFormWindowManagerInterface::AdjustSizeAction407サイズを調整
QDesignerFormWindowManagerInterface::SimplifyLayoutAction408QGridLayout を簡略化する またはQFormLayout
QDesignerFormWindowManagerInterface::DefaultPreviewAction500デフォルトのスタイルでプレビューを作成
QDesignerFormWindowManagerInterface::FormWindowSettingsDialogAction600フォーム設定のダイアログを表示

関連項目: action()

enum QDesignerFormWindowManagerInterface::ActionGroup

Qt Widgets Designer のアクショングループを指定します。

定数値説明
QDesignerFormWindowManagerInterface::StyledPreviewActionGroup100スタイルが適用されたプレビューアクションを含むアクショングループ

関連項目 :actionGroup()

メンバ関数のドキュメント

[explicit] QDesignerFormWindowManagerInterface::QDesignerFormWindowManagerInterface(QObject *parent = nullptr)

指定されたparent に基づいて、フォームウィンドウマネージャ用のインターフェースを構築します。

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

フォームウィンドウマネージャのインターフェースを破棄します。

[pure virtual] QAction *QDesignerFormWindowManagerInterface::action(QDesignerFormWindowManagerInterface::Action action) const

列挙値 `action` で指定されたアクションを返します。

Qt 4.X のアクションアクセサは非推奨となります。

[pure virtual] QActionGroup *QDesignerFormWindowManagerInterface::actionGroup(QDesignerFormWindowManagerInterface::ActionGroup actionGroup) const

列挙値actionGroup で指定されたアクショングループを返します。

[pure virtual] QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::activeFormWindow() const

Qt Widgets Designer のワークスペース内で現在アクティブなフォームウィンドウを返します。

setActiveFormWindow() およびremoveFormWindow()も参照してください 。

[signal] void QDesignerFormWindowManagerInterface::activeFormWindowChanged(QDesignerFormWindowInterface *formWindow)

このシグナルは、Qt Widgets Designer のワークスペース内で現在アクティブなフォームウィンドウの内容が変更されたときに発火します。引数として、現在アクティブなformWindow へのポインタが渡されます。

activeFormWindow()も参照してください 。

[pure virtual slot] void QDesignerFormWindowManagerInterface::addFormWindow(QDesignerFormWindowInterface *formWindow)

指定されたformWindow を、Qt Widgets Designer のフォームウィンドウマネージャが管理するウィンドウのコレクションに追加します。

formWindowAdded()も参照してください 。

[pure virtual slot] void QDesignerFormWindowManagerInterface::closeAllPreviews()

現在開いているすべてのプレビューを閉じます。

「showPreview()」も参照してください 。

[pure virtual] QDesignerFormEditorInterface *QDesignerFormWindowManagerInterface::core() const

Qt Widgets Designer の現在のQDesignerFormEditorInterface オブジェクトへのポインタを返します。

[pure virtual] QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::createFormWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())

指定されたparent と、指定されたウィンドウflags を使用して、フォームウィンドウを作成します。

addFormWindow()も参照してください 。

[pure virtual] QPixmap QDesignerFormWindowManagerInterface::createPreviewPixmap() const

現在アクティブなフォームのプレビューを表すピクマップを作成します。

[pure virtual] QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::formWindow(int index) const

指定されたindex にあるフォームウィンドウを返します。

setActiveFormWindow() およびremoveFormWindow()も参照してください 。

[signal] void QDesignerFormWindowManagerInterface::formWindowAdded(QDesignerFormWindowInterface *formWindow)

このシグナルは、Qt Widgets Designer のフォームウィンドウマネージャが管理するウィンドウのコレクションに、新しいフォームウィンドウが追加されたときに発せられます。引数として、新しいformWindow へのポインタが渡されます。

addFormWindow() およびsetActiveFormWindow()も参照してください 。

[pure virtual] int QDesignerFormWindowManagerInterface::formWindowCount() const

Qt Widgets Designer のフォームウィンドウマネージャーによって管理されているフォームウィンドウの数を返します。

[signal] void QDesignerFormWindowManagerInterface::formWindowRemoved(QDesignerFormWindowInterface *formWindow)

このシグナルは、Qt Widgets Designer のフォームウィンドウマネージャが管理するウィンドウの集合から、あるフォームウィンドウが削除されたときに発火します。削除されたformWindow へのポインタが引数として渡されます。

removeFormWindow()も参照してください 。

[signal] void QDesignerFormWindowManagerInterface::formWindowSettingsChanged(QDesignerFormWindowInterface *formWindow)

このシグナルは、フォームウィンドウの設定が変更されたときに発生します。これを利用して、ウィンドウのタイトルなどを適宜更新することができます。引数として、formWindow へのポインタが渡されます。

「FormWindowSettingsDialogAction」も参照してください 。

[pure virtual slot] void QDesignerFormWindowManagerInterface::removeFormWindow(QDesignerFormWindowInterface *formWindow)

指定されたformWindow を、Qt Widgets Designer のフォームウィンドウマネージャが管理するウィンドウのコレクションから削除します。

formWindow() およびformWindowRemoved()も参照してください 。

[pure virtual slot] void QDesignerFormWindowManagerInterface::setActiveFormWindow(QDesignerFormWindowInterface *formWindow)

指定されたformWindow を、Qt Widgets Designer のワークスペース内で現在アクティブなフォームウィンドウとして設定します。

activeFormWindow() およびactiveFormWindowChanged()も参照してください 。

[pure virtual slot] void QDesignerFormWindowManagerInterface::showPluginDialog()

Qt Widgets Designer によって読み込まれたプラグインと、プラグインの読み込みに失敗したものを表示するダイアログを開きます。

[pure virtual slot] void QDesignerFormWindowManagerInterface::showPreview()

デフォルトのパラメータを使用して、現在のフォームのプレビューを表示します。

closeAllPreviews()も参照してください 。

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