1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Use splitter instead of dock

This commit is contained in:
Jon Beniston 2022-09-28 22:01:26 +01:00
parent 82d609767c
commit ac64161e66
2 changed files with 9 additions and 16 deletions

View File

@ -15,8 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <QMainWindow>
#include <QDockWidget>
#include <QSplitter> #include <QSplitter>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QLabel> #include <QLabel>
@ -28,24 +26,21 @@
GLSpectrumTop::GLSpectrumTop(QWidget *parent) : GLSpectrumTop::GLSpectrumTop(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
m_mainWindow = new QMainWindow(); m_splitter = new QSplitter(Qt::Vertical);
m_dock = new QDockWidget();
m_dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
//m_dock->setTitleBarWidget(new QLabel("Measurements")); // Could add device or channel R:0 label and dock button?
m_dock->setVisible(false);
m_spectrum = new GLSpectrum(); m_spectrum = new GLSpectrum();
m_measurements = new SpectrumMeasurements(); m_measurements = new SpectrumMeasurements();
m_spectrum->setMeasurements(m_measurements); m_spectrum->setMeasurements(m_measurements);
m_dock->setWidget(m_measurements); m_splitter->addWidget(m_spectrum);
m_mainWindow->setCentralWidget(m_spectrum); m_splitter->addWidget(m_measurements);
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, m_dock);
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_mainWindow); layout->addWidget(m_splitter);
setLayout(layout); setLayout(layout);
m_measurements->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
} }
void GLSpectrumTop::setMeasurementsVisible(bool visible) void GLSpectrumTop::setMeasurementsVisible(bool visible)
{ {
m_dock->setVisible(visible); m_measurements->setVisible(visible);
} }

View File

@ -22,8 +22,7 @@
#include "export.h" #include "export.h"
class QMainWindow; class QSplitter;
class QDockWidget;
class GLSpectrum; class GLSpectrum;
class SpectrumMeasurements; class SpectrumMeasurements;
@ -38,8 +37,7 @@ public:
void setMeasurementsVisible(bool visible); void setMeasurementsVisible(bool visible);
private: private:
QMainWindow *m_mainWindow; QSplitter *m_splitter;
QDockWidget *m_dock;
GLSpectrum *m_spectrum; GLSpectrum *m_spectrum;
SpectrumMeasurements *m_measurements; SpectrumMeasurements *m_measurements;