From 5a265d7fe368c26b6a2d744fac837c48fce50ea2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 21 Apr 2022 21:44:57 +0200 Subject: [PATCH] Massive UI revamping (v7): fixed widget size handling: sample MIMO. Part of #1209 --- .../bladerf2mimo/bladerf2mimogui.cpp | 8 +++++ .../samplemimo/bladerf2mimo/bladerf2mimogui.h | 3 ++ .../bladerf2mimo/bladerf2mimogui.ui | 26 +++++++++------ .../samplemimo/limesdrmimo/limesdrmimogui.cpp | 8 +++++ .../samplemimo/limesdrmimo/limesdrmimogui.h | 3 ++ .../samplemimo/limesdrmimo/limesdrmimogui.ui | 32 +++++++++++-------- plugins/samplemimo/metismiso/metismisogui.cpp | 8 +++++ plugins/samplemimo/metismiso/metismisogui.h | 3 ++ plugins/samplemimo/metismiso/metismisogui.ui | 20 ++++++++---- .../plutosdrmimo/plutosdrmimogui.cpp | 8 +++++ .../samplemimo/plutosdrmimo/plutosdrmimogui.h | 3 ++ .../plutosdrmimo/plutosdrmimogui.ui | 26 +++++++++------ plugins/samplemimo/testmi/testmigui.cpp | 8 +++++ plugins/samplemimo/testmi/testmigui.h | 3 ++ plugins/samplemimo/testmi/testmigui.ui | 26 +++++++++------ .../samplemimo/testmosync/testmosyncgui.cpp | 1 + .../samplemimo/testmosync/testmosyncgui.ui | 30 +++++++++++++---- plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp | 8 +++++ plugins/samplemimo/xtrxmimo/xtrxmimogui.h | 3 ++ plugins/samplemimo/xtrxmimo/xtrxmimogui.ui | 26 +++++++++------ 20 files changed, 187 insertions(+), 66 deletions(-) diff --git a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp index 6621d25ac..433ebb37a 100644 --- a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp +++ b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -67,6 +68,7 @@ BladeRF2MIMOGui::BladeRF2MIMOGui(DeviceUISet *deviceUISet, QWidget* parent) : qDebug("BladeRF2MIMOGui::BladeRF2MIMOGui"); setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#BladeRF2MIMOGui { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/bladerf2mimo/readme.md"; @@ -143,6 +145,12 @@ bool BladeRF2MIMOGui::deserialize(const QByteArray& data) } } +void BladeRF2MIMOGui::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + void BladeRF2MIMOGui::displaySettings() { updateFrequencyLimits(); diff --git a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.h b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.h index b8ae967f6..66627d824 100644 --- a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.h +++ b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.h @@ -45,6 +45,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::BladeRF2MIMOGui* ui; diff --git a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.ui b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.ui index 12fc5c79a..b4ea73810 100644 --- a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.ui +++ b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.ui @@ -6,20 +6,26 @@ 0 0 - 360 - 220 + 370 + 208 - + 0 0 - 360 - 0 + 370 + 208 + + + + + 370 + 208 @@ -764,17 +770,17 @@ + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
TransverterButton QPushButton diff --git a/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp b/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp index 0e94a7ec5..5c6e9227c 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -69,6 +70,7 @@ LimeSDRMIMOGUI::LimeSDRMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : qDebug("LimeSDRMIMOGUI::LimeSDRMIMOGUI"); setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#LimeSDRMIMOGUI { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/limesdrmimo/readme.md"; @@ -143,6 +145,12 @@ bool LimeSDRMIMOGUI::deserialize(const QByteArray& data) } } +void LimeSDRMIMOGUI::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + void LimeSDRMIMOGUI::handleInputMessages() { Message* message; diff --git a/plugins/samplemimo/limesdrmimo/limesdrmimogui.h b/plugins/samplemimo/limesdrmimo/limesdrmimogui.h index 2352938c7..42f0a7845 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmimogui.h +++ b/plugins/samplemimo/limesdrmimo/limesdrmimogui.h @@ -45,6 +45,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::LimeSDRMIMOGUI* ui; diff --git a/plugins/samplemimo/limesdrmimo/limesdrmimogui.ui b/plugins/samplemimo/limesdrmimo/limesdrmimogui.ui index f5e2166b0..141c06234 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmimogui.ui +++ b/plugins/samplemimo/limesdrmimo/limesdrmimogui.ui @@ -6,8 +6,8 @@ 0 0 - 360 - 286 + 370 + 244
@@ -18,8 +18,14 @@ - 360 - 0 + 370 + 244 + + + + + 370 + 244 @@ -1323,6 +1329,11 @@ QToolTip{background-color: white; color: black;} + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget @@ -1330,21 +1341,16 @@ QToolTip{background-color: white; color: black;} 1 - ButtonSwitch - QToolButton -
gui/buttonswitch.h
+ ValueDialZ + QWidget +
gui/valuedialz.h
+ 1
TransverterButton QPushButton
gui/transverterbutton.h
- - ValueDialZ - QWidget -
gui/valuedialz.h
- 1 -
ExternalClockButton QToolButton diff --git a/plugins/samplemimo/metismiso/metismisogui.cpp b/plugins/samplemimo/metismiso/metismisogui.cpp index b7d5ce714..e359fae7a 100644 --- a/plugins/samplemimo/metismiso/metismisogui.cpp +++ b/plugins/samplemimo/metismiso/metismisogui.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -57,6 +58,7 @@ MetisMISOGui::MetisMISOGui(DeviceUISet *deviceUISet, QWidget* parent) : m_txSampleRate = 48000; ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#MetisMISOGui { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/metismiso/readme.md"; @@ -106,6 +108,12 @@ void MetisMISOGui::setCenterFrequency(qint64 centerFrequency) sendSettings(); } +void MetisMISOGui::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + QByteArray MetisMISOGui::serialize() const { return m_settings.serialize(); diff --git a/plugins/samplemimo/metismiso/metismisogui.h b/plugins/samplemimo/metismiso/metismisogui.h index adaa68cd2..5a79f96f2 100644 --- a/plugins/samplemimo/metismiso/metismisogui.h +++ b/plugins/samplemimo/metismiso/metismisogui.h @@ -46,6 +46,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::MetisMISOGui* ui; diff --git a/plugins/samplemimo/metismiso/metismisogui.ui b/plugins/samplemimo/metismiso/metismisogui.ui index c04ddc532..dd5259f47 100644 --- a/plugins/samplemimo/metismiso/metismisogui.ui +++ b/plugins/samplemimo/metismiso/metismisogui.ui @@ -7,7 +7,7 @@ 0 0 360 - 234 + 200
@@ -19,7 +19,13 @@ 360 - 0 + 200 + + + + + 360 + 200 @@ -810,17 +816,17 @@ + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
TransverterButton QPushButton diff --git a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp index 497e18a6e..cd4e12f49 100644 --- a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp +++ b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -69,6 +70,7 @@ PlutoSDRMIMOGUI::PlutoSDRMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : qDebug("PlutoSDRMIMOGui::PlutoSDRMIMOGui"); setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#PlutoSDRMIMOGUI { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/plutosdrmimo/readme.md"; @@ -146,6 +148,12 @@ bool PlutoSDRMIMOGUI::deserialize(const QByteArray& data) } } +void PlutoSDRMIMOGUI::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + void PlutoSDRMIMOGUI::displaySettings() { if (m_rxElseTx) diff --git a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.h b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.h index 3984ee6cc..0c32f2c07 100644 --- a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.h +++ b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.h @@ -45,6 +45,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::PlutoSDRMIMOGUI* ui; diff --git a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.ui b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.ui index ff49f0cbc..2ecdf064d 100644 --- a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.ui +++ b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.ui @@ -6,20 +6,26 @@ 0 0 - 360 - 319 + 370 + 278
- + 0 0 - 360 - 0 + 370 + 278 + + + + + 385 + 278 @@ -1260,17 +1266,17 @@ + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
TransverterButton QPushButton diff --git a/plugins/samplemimo/testmi/testmigui.cpp b/plugins/samplemimo/testmi/testmigui.cpp index 061305401..f5052d6b4 100644 --- a/plugins/samplemimo/testmi/testmigui.cpp +++ b/plugins/samplemimo/testmi/testmigui.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -62,6 +63,7 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) : m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#TestMIGui { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/testmi/readme.md"; @@ -124,6 +126,12 @@ bool TestMIGui::deserialize(const QByteArray& data) } } +void TestMIGui::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + void TestMIGui::on_startStop_toggled(bool checked) { if (m_doApplySettings) diff --git a/plugins/samplemimo/testmi/testmigui.h b/plugins/samplemimo/testmi/testmigui.h index 410fa1099..0fff5a4f9 100644 --- a/plugins/samplemimo/testmi/testmigui.h +++ b/plugins/samplemimo/testmi/testmigui.h @@ -46,6 +46,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::TestMIGui* ui; diff --git a/plugins/samplemimo/testmi/testmigui.ui b/plugins/samplemimo/testmi/testmigui.ui index 0baf16c66..162172ed1 100644 --- a/plugins/samplemimo/testmi/testmigui.ui +++ b/plugins/samplemimo/testmi/testmigui.ui @@ -6,20 +6,26 @@ 0 0 - 360 - 368 + 370 + 297
- + 0 0 - 360 - 0 + 370 + 297 + + + + + 370 + 297 @@ -1057,17 +1063,17 @@ + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
ValueDialZ QWidget diff --git a/plugins/samplemimo/testmosync/testmosyncgui.cpp b/plugins/samplemimo/testmosync/testmosyncgui.cpp index c4e3f45aa..92fbd050c 100644 --- a/plugins/samplemimo/testmosync/testmosyncgui.cpp +++ b/plugins/samplemimo/testmosync/testmosyncgui.cpp @@ -52,6 +52,7 @@ TestMOSyncGui::TestMOSyncGui(DeviceUISet *deviceUISet, QWidget* parent) : { setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); getContents()->setStyleSheet(QString(tr("#TestMOSyncGui { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/testmosync/readme.md"; diff --git a/plugins/samplemimo/testmosync/testmosyncgui.ui b/plugins/samplemimo/testmosync/testmosyncgui.ui index 8573a1ee6..a5b902822 100644 --- a/plugins/samplemimo/testmosync/testmosyncgui.ui +++ b/plugins/samplemimo/testmosync/testmosyncgui.ui @@ -11,7 +11,7 @@
- + 0 0 @@ -147,6 +147,12 @@ + + + 0 + 47 + + kHz @@ -263,6 +269,12 @@ + + + 0 + 29 + + SR @@ -326,6 +338,12 @@ + + + 0 + 0 + + 200 @@ -348,17 +366,17 @@ + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
GLSpectrum QWidget diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp b/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp index dea49ea2d..1aaab21f3 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp +++ b/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -66,6 +67,7 @@ XTRXMIMOGUI::XTRXMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : qDebug("XTRXMIMOGUI::XTRXMIMOGUI"); setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(getContents()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getContents()->setStyleSheet(QString(tr("#XTRXMIMOGUI { border: 1px solid %1 }") .arg(palette().highlight().color().darker(115).name()))); m_helpURL = "plugins/samplemimo/xtrxmimo/readme.md"; @@ -140,6 +142,12 @@ bool XTRXMIMOGUI::deserialize(const QByteArray& data) } } +void XTRXMIMOGUI::resizeEvent(QResizeEvent* size) +{ + adjustSize(); + size->accept(); +} + void XTRXMIMOGUI::handleInputMessages() { Message* message; diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimogui.h b/plugins/samplemimo/xtrxmimo/xtrxmimogui.h index a41eee57b..9b72ab2a9 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimogui.h +++ b/plugins/samplemimo/xtrxmimo/xtrxmimogui.h @@ -45,6 +45,9 @@ public: bool deserialize(const QByteArray& data); virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +protected: + void resizeEvent(QResizeEvent* size); + private: Ui::XTRXMIMOGUI* ui; diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimogui.ui b/plugins/samplemimo/xtrxmimo/xtrxmimogui.ui index 6fcea580a..19ba68c81 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimogui.ui +++ b/plugins/samplemimo/xtrxmimo/xtrxmimogui.ui @@ -6,20 +6,26 @@ 0 0 - 360 - 284 + 370 + 242
- + 0 0 - 360 - 0 + 370 + 242 + + + + + 370 + 242 @@ -1278,17 +1284,17 @@ QToolTip{background-color: white; color: black;} + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
ValueDial QWidget
gui/valuedial.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
ValueDialZ QWidget