Made a step in removing knowledge of DatabaseWindow from QueryTab as an effort to move
in the direction of a plugin system. DatabaseWindow now passes a Context to QueryTab and other pages that give those pages an API for passing information up the system without knowing anything about the sytem.
This commit is contained in:
parent
f6ea2ce0a6
commit
2a7e505dbf
13 changed files with 220 additions and 113 deletions
33
pglab/PluginContentWidget.h
Normal file
33
pglab/PluginContentWidget.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef PGLPAGE_H
|
||||
#define PGLPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <vector>
|
||||
|
||||
class IPluginContentWidgetContext;
|
||||
|
||||
/// Provides a pluggable system for toolbar buttons and menu actions
|
||||
///
|
||||
/// We will need several kind of actions
|
||||
/// - create actions, these will create a new document or load from file , always available in menu
|
||||
/// - save actions available when on tab
|
||||
/// - edit actions
|
||||
/// - custom menu?
|
||||
///
|
||||
/// Can we use same groupings for toolbars and menu's
|
||||
/// How about additional toolbars?
|
||||
///
|
||||
class PluginContentWidget: public QWidget{
|
||||
public:
|
||||
PluginContentWidget(IPluginContentWidgetContext *context, QWidget* parent = nullptr);
|
||||
/// Returns the toolbar buttons for this page
|
||||
virtual std::vector<QAction*> getToolbarActions();
|
||||
virtual bool canClose();
|
||||
|
||||
protected:
|
||||
IPluginContentWidgetContext *context() { return m_context; }
|
||||
private:
|
||||
IPluginContentWidgetContext *m_context;
|
||||
};
|
||||
|
||||
#endif // PGLPAGE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue