5#include <QtGui/qaction.h>
10#include <iconloader_p.h>
12#include <QtDesigner/abstractformwindow.h>
13#include <QtDesigner/abstractformwindowmanager.h>
14#include <QtDesigner/abstractformeditor.h>
18using namespace Qt::StringLiterals;
35 m_action =
new QAction(tr(
"Edit Buddies"),
this);
36 m_action->setObjectName(u"__qt_edit_buddies_action"_s);
37 m_action->setIcon(createIconSet(
"buddytool.png"_L1));
38 m_action->setEnabled(
false);
44 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
45 this, &BuddyEditorPlugin::addFormWindow);
47 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowRemoved,
50 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
51 this, &BuddyEditorPlugin::activeFormWindowChanged);
61 Q_ASSERT(formWindow !=
nullptr);
62 Q_ASSERT(m_tools.contains(formWindow) ==
false);
65 m_tools[formWindow] = tool;
66 connect(m_action, &QAction::triggered, tool
->action(), &QAction::trigger);
67 formWindow->registerTool(tool);
72 Q_ASSERT(formWindow !=
nullptr);
73 Q_ASSERT(m_tools.contains(formWindow) ==
true);
76 m_tools.remove(formWindow);
77 disconnect(m_action, &QAction::triggered, tool
->action(), &QAction::trigger);
90 m_action->setEnabled(formWindow !=
nullptr);
bool isInitialized() const override
Returns true if the plugin interface is initialized; otherwise returns false.
QDesignerFormEditorInterface * core() const override
Returns the core form editor interface associated with this component.
QAction * action() const override
Returns the action associated with this interface.
~BuddyEditorPlugin() override
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.