diff --git a/pglab/QueryTab.cpp b/pglab/QueryTab.cpp index 5331d4d..580804d 100644 --- a/pglab/QueryTab.cpp +++ b/pglab/QueryTab.cpp @@ -650,7 +650,9 @@ std::vector QueryTab::getToolbarActions() // Execute SQL action = new QAction(QIcon(":/icons/script_go.png"), tr("Execute"), this); action->setShortcut(QKeySequence(Qt::Key_F5)); - connect(action, &QAction::triggered, this, &QueryTab::execute); + //connect(action, &QAction::triggered, this, &QueryTab::execute); + std::string slot_name = SLOT(execute()); + connect(action, SIGNAL(triggered()), this, slot_name.c_str()); actions.push_back(action); // Explain action = new QAction(QIcon(":/icons/lightbulb_off.png"), tr("Explain"), this); @@ -678,6 +680,7 @@ void QueryToolModule::init() { menuAction_new(context); }); ma_new.setMenuLocation(MenuPath("File/New")); ma_new.setIcon(QIcon(":/icons/new_query_tab.png")); + ma_new.setShortCut(QKeySequence(Qt::CTRL + Qt::Key_N)); registerMenuAction(ma_new); } diff --git a/pglab/QueryTab.h b/pglab/QueryTab.h index abcd7ef..c6ca87c 100644 --- a/pglab/QueryTab.h +++ b/pglab/QueryTab.h @@ -44,7 +44,6 @@ public: bool saveAs(); void saveCopyAs(); - void execute(); void explain(bool analyze); void cancel(); @@ -61,6 +60,8 @@ public: void focusEditor(); virtual std::vector getToolbarActions() override; +public slots: + void execute(); private: using ResultTabContainer = std::vector;