4#include <QtGui/qaction.h>
9#include <QtDesigner/abstractformwindow.h>
10#include <QtDesigner/abstractformwindowmanager.h>
11#include <QtDesigner/abstractformeditor.h>
15using namespace Qt::StringLiterals;
32 m_action =
new QAction(tr(
"Edit Buddies"),
this);
33 m_action->setObjectName(u"__qt_edit_buddies_action"_s);
34 QIcon buddyIcon = QIcon::fromTheme(u"designer-edit-buddy"_s,
35 QIcon(core->resourceLocation() +
"/buddytool.png"_L1));
36 m_action->setIcon(buddyIcon);
37 m_action->setEnabled(
false);
43 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
44 this, &BuddyEditorPlugin::addFormWindow);
46 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowRemoved,
47 this, &BuddyEditorPlugin::removeFormWindow);
49 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
50 this, &BuddyEditorPlugin::activeFormWindowChanged);
60 Q_ASSERT(formWindow !=
nullptr);
61 Q_ASSERT(m_tools.contains(formWindow) ==
false);
64 m_tools[formWindow] = tool;
65 connect(m_action, &QAction::triggered, tool->action(), &QAction::trigger);
66 formWindow->registerTool(tool);
71 Q_ASSERT(formWindow !=
nullptr);
72 Q_ASSERT(m_tools.contains(formWindow) ==
true);
75 m_tools.remove(formWindow);
76 disconnect(m_action, &QAction::triggered, tool->action(), &QAction::trigger);
89 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.