diff --git a/mainwindow.cpp b/mainwindow.cpp
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -66,6 +66,12 @@ MainWindow::MainWindow(QWidget *parent)
setupAboutDialog();
+ // init view menu
+ for (auto a : ui->plot->menuActions())
+ {
+ ui->menuView->addAction(a);
+ }
+
// init UI signals
// menu signals
@@ -78,24 +84,6 @@ MainWindow::MainWindow(QWidget *parent)
QObject::connect(ui->actionQuit, &QAction::triggered,
this, &MainWindow::close);
- QObject::connect(ui->actionGrid, &QAction::toggled, [this](bool show)
- {
- ui->plot->showGrid(show);
- ui->actionMinorGrid->setEnabled(show);
- });
-
- ui->actionMinorGrid->setEnabled(ui->actionGrid->isChecked());
- QObject::connect(ui->actionMinorGrid, &QAction::toggled,
- ui->plot, &Plot::showMinorGrid);
-
- QObject::connect(ui->actionUnzoom, &QAction::triggered,
- ui->plot, &Plot::unzoom);
-
- QObject::connect(ui->actionDarkBackground, &QAction::toggled,
- ui->plot, &Plot::darkBackground);
-
- ui->plot->darkBackground(ui->actionDarkBackground->isChecked());
-
// port control signals
QObject::connect(&portControl, &PortControl::portToggled,
this, &MainWindow::onPortToggled);
@@ -169,10 +157,6 @@ MainWindow::MainWindow(QWidget *parent)
ui->plot->setAxis(ui->cbAutoScale->isChecked(),
ui->spYmin->value(), ui->spYmax->value());
- // init grid
- ui->plot->showGrid(ui->actionGrid->isChecked());
- ui->plot->showMinorGrid(ui->actionMinorGrid->isChecked());
-
// init scale range preset list
for (int nbits = 8; nbits <= 24; nbits++) // signed binary formats
{
diff --git a/mainwindow.ui b/mainwindow.ui
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -483,10 +483,6 @@
View
-
-
-
-
@@ -560,50 +556,6 @@
Ctrl+Q
-
-
- true
-
-
- Grid
-
-
- Show/hide grid
-
-
- G
-
-
-
-
- UnZoom
-
-
-
-
- true
-
-
- Minor Grid
-
-
- Show/hide minor grid
-
-
- M
-
-
-
-
- true
-
-
- Dark Background
-
-
- Toggle Dark Background
-
-
diff --git a/plot.cpp b/plot.cpp
--- a/plot.cpp
+++ b/plot.cpp
@@ -42,6 +42,7 @@ Plot::Plot(QWidget* parent) :
rectItem.setRect(QRectF(0,0,100,1));
// rectItem.attach(this);
+ showGrid(false);
darkBackground(false);
_showGridAction.setToolTip("Show Grid");
@@ -56,10 +57,12 @@ Plot::Plot(QWidget* parent) :
_showMinorGridAction.setCheckable(true);
_darkBackgroundAction.setCheckable(true);
- _showGridAction.setChecked(true);
+ _showGridAction.setChecked(false);
_showMinorGridAction.setChecked(false);
_darkBackgroundAction.setChecked(false);
+ _showMinorGridAction.setEnabled(false);
+
connect(&_showGridAction, SELECT::OVERLOAD_OF(&QAction::triggered),
this, &Plot::showGrid);
connect(&_showGridAction, SELECT::OVERLOAD_OF(&QAction::triggered),