Icons on action supplied by the PlgPages.

This commit is contained in:
eelke 2018-05-20 13:42:30 +02:00
parent 3d516e6006
commit 4dd526f32a
3 changed files with 16 additions and 1 deletions

View file

@ -68,3 +68,14 @@ void CrudTab::on_actionRemove_rows_triggered()
m_crudModel->removeRow(ui->tableView->currentIndex().row());
//removeRows();
}
std::vector<QAction*> CrudTab::getToolbarActions()
{
if (actions.empty()) {
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);
actions.push_back(action);
}
return actions;
}

View file

@ -25,6 +25,8 @@ public:
void setConfig(std::shared_ptr<OpenDatabase> db, const PgClass &table);
void refresh();
virtual std::vector<QAction*> getToolbarActions() override;
private:
Ui::CrudTab *ui;
@ -34,6 +36,7 @@ private:
PgClass m_table;
CrudModel *m_crudModel = nullptr;
std::vector<QAction*> actions;
private slots:
// void tableView_currentRowChanged(const QModelIndex &current, const QModelIndex &previous);

View file

@ -607,7 +607,8 @@ void QueryTab::focusEditor()
std::vector<QAction*> QueryTab::getToolbarActions()
{
if (actions.empty()) {
QAction *action = new QAction(tr("Execute"), this);
QAction *action = new QAction(QIcon(":/icons/script_go.png"), tr("Execute"), this);
action->setShortcut(QKeySequence(Qt::Key_F5));
connect(action, &QAction::triggered, this, &QueryTab::execute);
actions.push_back(action);
}