First tab at building a mechanism where tabpages can supply a list of actions that are added to the global main toolbar.

This commit is contained in:
eelke 2018-05-14 20:24:41 +02:00
parent c2d725ec6d
commit 3d516e6006
10 changed files with 130 additions and 26 deletions

View file

@ -22,7 +22,7 @@
#include "GlobalIoService.h"
QueryTab::QueryTab(MainWindow *win, QWidget *parent) :
PglPage(parent),
PlgPage(parent),
ui(new Ui::QueryTab),
m_win(win),
m_dbConnection(*getGlobalAsioIoService())
@ -603,3 +603,13 @@ void QueryTab::focusEditor()
{
ui->queryEdit->setFocus();
}
std::vector<QAction*> QueryTab::getToolbarActions()
{
if (actions.empty()) {
QAction *action = new QAction(tr("Execute"), this);
connect(action, &QAction::triggered, this, &QueryTab::execute);
actions.push_back(action);
}
return actions;
}