context menu link
This commit is contained in:
parent
1c13a6e6ef
commit
dc893ef1bd
|
@ -157,6 +157,7 @@ private slots:
|
|||
void on_actionExecuteFile_triggered();
|
||||
void on_actionExecuteSelection_triggered();
|
||||
void on_actionSplitTab_triggered();
|
||||
void on_actionOpenContextMenu_triggered();
|
||||
void fileBrowserOpen(QString file);
|
||||
void focusTreeTriggered();
|
||||
void previousTabTriggered();
|
||||
|
|
|
@ -991,6 +991,17 @@ void MainWindow::on_actionSplitTab_triggered()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOpenContextMenu_triggered()
|
||||
{
|
||||
QWidget * widget = QApplication::focusWidget();
|
||||
if (widget == nullptr) return;
|
||||
int key = QKeySequence::fromString(QString::fromStdString(settings->get("shortcut_context_menu")))[0];
|
||||
QKeyEvent * pressEvent = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier);
|
||||
QCoreApplication::postEvent(widget, pressEvent);
|
||||
QKeyEvent * releaseEvent = new QKeyEvent(QEvent::KeyRelease, key, Qt::NoModifier);
|
||||
QCoreApplication::postEvent(widget, releaseEvent);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOpenFile_triggered()
|
||||
{
|
||||
setStatusBarText("");
|
||||
|
|
|
@ -183,6 +183,8 @@
|
|||
<addaction name="actionExecuteSelection"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSplitTab"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOpenContextMenu"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
|
@ -1169,6 +1171,11 @@
|
|||
<string>Split tab</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpenContextMenu">
|
||||
<property name="text">
|
||||
<string>Context menu</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
Loading…
Reference in a new issue