DatabaseWindow has no knowledge more of the existence of QueryTab but user can still create and use them within that window.
This commit is contained in:
parent
fd603a7434
commit
d0c4dabe8b
8 changed files with 327 additions and 451 deletions
58
pglab/plugin_support/LMainWindow.h
Normal file
58
pglab/plugin_support/LMainWindow.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#ifndef LMAINWINDOW_H
|
||||
#define LMAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class IPluginContentWidgetContext;
|
||||
class MenuAction;
|
||||
class PluginContentWidget;
|
||||
|
||||
namespace LMainWindow_details {
|
||||
class LMainWindowContentContext;
|
||||
}
|
||||
|
||||
class LMainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
LMainWindow(QWidget *parent = nullptr);
|
||||
~LMainWindow();
|
||||
|
||||
void initModuleMenus();
|
||||
void setTabCaptionForWidget(QWidget *widget, const QString &caption, const QString &hint);
|
||||
void setTabIcon(QWidget *widget, const QString &iconname);
|
||||
|
||||
/// Called when a newly created page is added to the QTabWidget
|
||||
void addPage(PluginContentWidget* page, QString caption);
|
||||
|
||||
IPluginContentWidgetContext* context();
|
||||
protected:
|
||||
QTabWidget *m_tabWidget = nullptr;
|
||||
QToolBar *m_mainToolBar = nullptr;
|
||||
|
||||
// Standard menu's
|
||||
QMenu *m_fileMenu = nullptr;
|
||||
|
||||
// Standard actions
|
||||
QAction *m_closeAction = nullptr;
|
||||
|
||||
|
||||
void addModuleMenuActions();
|
||||
|
||||
void addToolBarButtonsForPage(PluginContentWidget *page);
|
||||
void removeToolBarButtonsForPage(PluginContentWidget *page);
|
||||
private:
|
||||
LMainWindow_details::LMainWindowContentContext *m_context;
|
||||
PluginContentWidget *m_previousPage = nullptr; ///< tracks which pages buttons were previously being displayed
|
||||
|
||||
void createActions();
|
||||
void addMenuAction(const MenuAction &ma);
|
||||
|
||||
private slots:
|
||||
void actionClose_triggered();
|
||||
void tabWidget_tabCloseRequested(int index);
|
||||
void tabWidget_currentChanged(int index);
|
||||
};
|
||||
|
||||
|
||||
#endif // LMAINWINDOW_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue