- Moved detail tabs of table to their own components - Table list has become seperate component on seperate tab - Table list does not use designer anymore - Moved sequences and functions tabs into the catalog inspector
68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
#ifndef PLUGINCONTENTWIDGETCONTEXTBASE_H
|
|
#define PLUGINCONTENTWIDGETCONTEXTBASE_H
|
|
|
|
#include "plugin_support/IPluginContentWidgetContext.h"
|
|
#include <QList>
|
|
|
|
class LContextAction;
|
|
class QToolBar;
|
|
class QAction;
|
|
|
|
/// Maintains the list of actions added to a toolbar for a specific widget
|
|
/// it facilitates the removal of all those actions.
|
|
class WidgetToolbarActionList {
|
|
public:
|
|
QToolBar *m_toolBar;
|
|
std::vector<QAction*> m_actions;
|
|
void removeAll()
|
|
{
|
|
// for (auto && a : m_actions)
|
|
// m_toolBar->removeAction(a);
|
|
}
|
|
};
|
|
|
|
class WidgetToolbarManager {
|
|
public:
|
|
void addAction(QAction *action, QString section);
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
class LWidgetData {
|
|
public:
|
|
LWidgetData(PluginModule *module);
|
|
PluginModule* module() { return m_module; }
|
|
void init(PluginContentWidget *widget);
|
|
|
|
private:
|
|
PluginModule *m_module;
|
|
WidgetToolbarManager m_toolbarManager;
|
|
};
|
|
|
|
/// Provides base implementation of IPluginContentWidgetContext
|
|
class PluginContentWidgetContextBase : public IPluginContentWidgetContext
|
|
{
|
|
public:
|
|
PluginContentWidgetContextBase();
|
|
|
|
void moduleAction(
|
|
const QString &module_identifier,
|
|
QString module_action,
|
|
const ModuleActionParameters &action_params
|
|
) override;
|
|
|
|
void addContentWidget(PluginModule *module, PluginContentWidget *widget) override;
|
|
void removeContentWidget(PluginContentWidget *widget) override;
|
|
|
|
void addWidgetActionsToToolbar(PluginContentWidget *widget, QToolBar *toolbar);
|
|
void removeWidgetActionsFromToolbar(PluginContentWidget *widget, QToolBar *toolbar);
|
|
private:
|
|
|
|
using WidgetLst = std::map<PluginContentWidget*, LWidgetData>;
|
|
|
|
WidgetLst m_widgetLst;
|
|
};
|
|
|
|
#endif // PLUGINCONTENTWIDGETCONTEXTBASE_H
|