Overview of triggers extended with function name and arguments.

Did a lot of refactoring on the catalog to keep things clean.
This commit is contained in:
eelke 2018-11-18 19:30:45 +01:00
parent 35813ae926
commit fcb191f2cc
44 changed files with 797 additions and 404 deletions

View file

@ -4,6 +4,7 @@
#include "MainWindow.h"
#include "ResultTableModelUtil.h"
#include "PgLabItemDelegate.h"
#include <QMenu>
CrudTab::CrudTab(MainWindow *parent)
@ -23,6 +24,12 @@ CrudTab::CrudTab(MainWindow *parent)
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->addAction(ui->actionRemove_rows);
auto horizontal_header = ui->tableView->horizontalHeader();
horizontal_header->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
connect(horizontal_header, &QHeaderView::customContextMenuRequested,
this, &CrudTab::headerCustomContextMenu);
//auto selection_model = ui->tableView->selectionModel();
// connect(ui->tableView->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
// &CrudTab::tableView_currentRowChanged);
@ -79,3 +86,16 @@ std::vector<QAction*> CrudTab::getToolbarActions()
}
return actions;
}
void CrudTab::headerCustomContextMenu(const QPoint &pos)
{
auto menu = new QMenu(this);
QAction *action = new QAction(QIcon(":/icons/script_go.png"), tr("Refresh"), this);
action->setShortcut(QKeySequence(Qt::Key_F5));
connect(action, &QAction::triggered, this, &CrudTab::refresh);
menu->addAction(action);
auto horizontal_header = ui->tableView->horizontalHeader();
menu->popup(horizontal_header->mapToGlobal(pos));
}