7#include <QtDesigner/abstractformeditor.h>
8#include <QtDesigner/abstractformwindowmanager.h>
10#include <QtGui/qaction.h>
14using namespace Qt::StringLiterals;
31 m_action =
new QAction(tr(
"Edit Signals/Slots"),
this);
32 m_action->setObjectName(u"__qt_edit_signals_slots_action"_s);
33 m_action->setShortcut(tr(
"F4"));
34 QIcon icon = QIcon::fromTheme(u"designer-edit-signals"_s,
35 QIcon(core->resourceLocation() +
"/signalslottool.png"_L1));
36 m_action->setIcon(icon);
37 m_action->setEnabled(
false);
43 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
44 this, &SignalSlotEditorPlugin::addFormWindow);
46 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowRemoved,
47 this, &SignalSlotEditorPlugin::removeFormWindow);
49 connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
50 this, &SignalSlotEditorPlugin::activeFormWindowChanged);
60 Q_ASSERT(formWindow !=
nullptr);
61 Q_ASSERT(m_tools.contains(formWindow) ==
false);
64 connect(m_action, &QAction::triggered, tool->action(), &QAction::trigger);
65 m_tools[formWindow] = tool;
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);
96#include "moc_signalsloteditor_plugin.cpp"
bool isInitialized() const override
Returns true if the plugin interface is initialized; otherwise returns false.
QAction * action() const override
Returns the action associated with this interface.
~SignalSlotEditorPlugin() override
QDesignerFormEditorInterface * core() const override
Returns the core form editor interface associated with this component.
void initialize(QDesignerFormEditorInterface *core) override
Initializes the plugin interface for the specified core interface.
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.