Commit 8d79bbf6 authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Shortcuts in the GE widget should work even if the widget has no menubar.

parent 0a5ead5a
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <QApplication> #include <QApplication>
#include <QMenuBar> #include <QMenuBar>
#include <QMessageBox> #include <QMessageBox>
#include <QShortcut>
#include <QVBoxLayout> #include <QVBoxLayout>
void WGeQtWidget::focusInEvent(QFocusEvent* event) void WGeQtWidget::focusInEvent(QFocusEvent* event)
...@@ -246,6 +247,11 @@ WGeQt::WGeQt(void* wge_parent_ctx, char* wge_name, char* wge_filename, ...@@ -246,6 +247,11 @@ WGeQt::WGeQt(void* wge_parent_ctx, char* wge_name, char* wge_filename,
"$pwr_exe/xtt_help.png"); "$pwr_exe/xtt_help.png");
graph_form->setMenuBar(menu_bar); graph_form->setMenuBar(menu_bar);
} else {
new QShortcut(QKeySequence("CTRL+W"), toplevel, SLOT(close()));
new QShortcut(QKeySequence("CTRL+I"), toplevel, SLOT(activate_zoom_in()));
new QShortcut(QKeySequence("CTRL+O"), toplevel, SLOT(activate_zoom_out()));
new QShortcut(QKeySequence("CTRL+H"), toplevel, SLOT(activate_help()));
} }
add_expanding(graph_form, grow_widget); add_expanding(graph_form, grow_widget);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "xtt_xnav.h" #include "xtt_xnav.h"
#include <QMenuBar> #include <QMenuBar>
#include <QShortcut>
#include <QVBoxLayout> #include <QVBoxLayout>
void XttGeQtWidget::focusInEvent(QFocusEvent* event) void XttGeQtWidget::focusInEvent(QFocusEvent* event)
...@@ -326,6 +327,11 @@ XttGeQt::XttGeQt(void* xg_parent_ctx, const char* xg_name, ...@@ -326,6 +327,11 @@ XttGeQt::XttGeQt(void* xg_parent_ctx, const char* xg_name,
"$pwr_exe/xtt_help.png"); "$pwr_exe/xtt_help.png");
graph_form->setMenuBar(menu_bar); graph_form->setMenuBar(menu_bar);
} else {
new QShortcut(QKeySequence("CTRL+W"), toplevel, SLOT(close()));
new QShortcut(QKeySequence("CTRL+I"), toplevel, SLOT(activate_zoom_in()));
new QShortcut(QKeySequence("CTRL+O"), toplevel, SLOT(activate_zoom_out()));
new QShortcut(QKeySequence("CTRL+H"), toplevel, SLOT(activate_help()));
} }
add_expanding(graph_form, grow_widget); add_expanding(graph_form, grow_widget);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment