diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -104,12 +104,29 @@ MainWindow::MainWindow(QWidget *parent) tbMenu->addAction(ui->plotToolBar->toggleViewAction()); tbMenu->addAction(portControl.toolBar()->toggleViewAction()); + // init secondary plot menu + auto group = new QActionGroup(this); + group->addAction(ui->actionVertical); + group->addAction(ui->actionHorizontal); + // init UI signals // Secondary plot menu signals connect(ui->actionBarPlot, &QAction::triggered, this, &MainWindow::showBarPlot); + connect(ui->actionVertical, &QAction::triggered, + [this](bool checked) + { + if (checked) ui->splitter->setOrientation(Qt::Vertical); + }); + + connect(ui->actionHorizontal, &QAction::triggered, + [this](bool checked) + { + if (checked) ui->splitter->setOrientation(Qt::Horizontal); + }); + // Help menu signals QObject::connect(ui->actionHelpAbout, &QAction::triggered, &aboutDialog, &QWidget::show); diff --git a/src/mainwindow.ui b/src/mainwindow.ui --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -129,8 +129,8 @@ + - @@ -264,6 +264,9 @@ true + + true + Horizontal