diff --git a/fastgraph.cpp b/fastgraph.cpp index b164e8fac..11fb37931 100644 --- a/fastgraph.cpp +++ b/fastgraph.cpp @@ -12,14 +12,14 @@ FastGraph::FastGraph(QSettings * settings, QWidget *parent) : QDialog {parent, Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint}, - m_settings (settings), - ui(new Ui::FastGraph) + m_settings {settings}, + m_ave {40}, + ui {new Ui::FastGraph} { ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Fast Graph")); installEventFilter(parent); //Installing the filter ui->fastPlot->setCursor(Qt::CrossCursor); - m_ave=40; //Restore user's settings m_settings->beginGroup("FastGraph"); @@ -30,6 +30,7 @@ FastGraph::FastGraph(QSettings * settings, QWidget *parent) : ui->gainSlider->setValue(ui->fastPlot->m_plotGain); ui->fastPlot->setGreenZero(m_settings->value("GreenZero", 0).toInt()); ui->greenZeroSlider->setValue(ui->fastPlot->m_greenZero); + ui->controls_widget->setVisible (!m_settings->value("HideControls", false).toBool ()); m_settings->endGroup(); connect (ui->fastPlot, &FPlotter::fastPick, this, &FastGraph::fastPick); @@ -55,6 +56,7 @@ void FastGraph::saveSettings() m_settings->setValue("PlotGain",ui->fastPlot->m_plotGain); m_settings->setValue("GreenZero",ui->fastPlot->m_greenZero); m_settings->setValue("GreenGain",ui->fastPlot->m_greenGain); + m_settings->setValue("HideControls",!ui->controls_widget->isVisible ()); m_settings->endGroup(); } @@ -105,3 +107,17 @@ void FastGraph::setMode(QString mode) //setMode { ui->fastPlot->setMode(mode); } + +void FastGraph::keyPressEvent(QKeyEvent *e) +{ + switch(e->key()) + { + case Qt::Key_M: + if(e->modifiers() & Qt::ControlModifier) { + ui->controls_widget->setVisible (!ui->controls_widget->isVisible ()); + } + break; + default: + QDialog::keyPressEvent (e); + } +} diff --git a/fastgraph.h b/fastgraph.h index b7671b35e..d19bdaba4 100644 --- a/fastgraph.h +++ b/fastgraph.h @@ -16,6 +16,7 @@ class FastGraph : public QDialog protected: void closeEvent (QCloseEvent *) override; + void keyPressEvent( QKeyEvent *e ) override; public: explicit FastGraph(QSettings *, QWidget *parent = 0); diff --git a/fastgraph.ui b/fastgraph.ui index 3ce550c17..773c223ba 100644 --- a/fastgraph.ui +++ b/fastgraph.ui @@ -1,257 +1,238 @@ - - - FastGraph - - - - 0 - 0 - 710 - 250 - - - - - 0 - 0 - - - - - 710 - 250 - - - - - 710 - 250 - - - - Fast Graph - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - 2 - - - - - true - - - - 0 - 0 - - - - - 703 - 220 - - - - - 703 - 220 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 1 - - - - - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Waterfall gain - - - -60 - - - 140 - - - 40 - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - Waterfall zero - - - -60 - - - 120 - - - 60 - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - Spectrum zero - - - -100 - - - 160 - - - 30 - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - <html><head/><body><p>Set reasonable levels for gain and zero sliders.</p></body></html> - - - Auto Level - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - - - - - FPlotter - QFrame -
fastplot.h
- 1 -
-
- - -
+ + + FastGraph + + + Fast Graph + + + + 2 + + + QLayout::SetFixedSize + + + 2 + + + 2 + + + 2 + + + 2 + + + + + true + + + + 0 + 0 + + + + + 703 + 220 + + + + + 703 + 220 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 1 + + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 99 + 20 + + + + + + + + Waterfall gain + + + -60 + + + 140 + + + 40 + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + Waterfall zero + + + -60 + + + 120 + + + 60 + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + Spectrum zero + + + -100 + + + 160 + + + 30 + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + <html><head/><body><p>Set reasonable levels for gain and zero sliders.</p></body></html> + + + Auto Level + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 99 + 20 + + + + + + + + + + + + FPlotter + QFrame +
fastplot.h
+ 1 +
+
+ + +