This is a proposed solution to reenable the <Space> shortcut for
Run/Stop. It seems that setShortcut on QToolButton is not working, but
it seems that adding QShortcut works as a workaround.
#include <QMessageBox>
#include <QSettings>
#include <QWidget>
#include <QMessageBox>
#include <QSettings>
#include <QWidget>
#include "mainwindow.hpp"
#include "mainwindow.hpp"
run_stop_button_ = new QToolButton();
run_stop_button_->setAutoRaise(true);
run_stop_button_->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
run_stop_button_ = new QToolButton();
run_stop_button_->setAutoRaise(true);
run_stop_button_->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- run_stop_button_->setShortcut(QKeySequence(Qt::Key_Space));
run_stop_button_->setToolTip(tr("Start/Stop Acquisition"));
run_stop_button_->setToolTip(tr("Start/Stop Acquisition"));
+ run_stop_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Space), run_stop_button_, SLOT(click()));
+ run_stop_shortcut_->setAutoRepeat(false);
+
settings_button_ = new QToolButton();
settings_button_->setIcon(QIcon::fromTheme("configure",
QIcon(":/icons/configure.png")));
settings_button_ = new QToolButton();
settings_button_->setIcon(QIcon::fromTheme("configure",
QIcon(":/icons/configure.png")));
#include <QSignalMapper>
#include <QToolButton>
#include <QTabWidget>
#include <QSignalMapper>
#include <QToolButton>
#include <QTabWidget>
#include "session.hpp"
#include "views/viewbase.hpp"
#include "session.hpp"
#include "views/viewbase.hpp"
QIcon icon_red_;
QIcon icon_green_;
QIcon icon_grey_;
QIcon icon_red_;
QIcon icon_green_;
QIcon icon_grey_;
+
+ QShortcut *run_stop_shortcut_;