diff --git a/GUI/View/Instrument/DetectorEditor.cpp b/GUI/View/Instrument/DetectorEditor.cpp index 294b9ada1185476d5ae4ec9b03622ebb3fe4174f..f184e4b59d4bc28c914a9cc2b8817088734a69e3 100644 --- a/GUI/View/Instrument/DetectorEditor.cpp +++ b/GUI/View/Instrument/DetectorEditor.cpp @@ -87,7 +87,8 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) ::createSpinBox(xAxisFormLayout, detectorItem->u0(), this); - auto* xAxisGroupBox = new GroupBox("X axis", xAxisFormLayout, this); + auto* xAxisGroupBox = new HeinzGroupBox("X axis", this); + xAxisGroupBox->body()->setLayout(xAxisFormLayout); xyrow->addWidget(xAxisGroupBox); //... y-axis controls @@ -112,7 +113,8 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) ::createSpinBox(yAxisFormLayout, detectorItem->v0(), this); - auto* yAxisGroupBox = new GroupBox("Y axis", yAxisFormLayout, this); + auto* yAxisGroupBox = new HeinzGroupBox("Y axis", this); + yAxisGroupBox->body()->setLayout(yAxisFormLayout); xyrow->addWidget(yAxisGroupBox); //... resolution controls @@ -120,7 +122,8 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem) auto resolutionLayout = new QFormLayout; resolutionLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); - auto* resolutionForm = new GroupBox("Resolution function", resolutionLayout, this); + auto* resolutionForm = new HeinzGroupBox("Resolution function", this); + resolutionForm->body()->setLayout(resolutionLayout); auto updateResolutionForm = [parent = this, layout = resolutionLayout, item = detectorItem]() -> void { diff --git a/GUI/View/Widget/GroupBoxes.cpp b/GUI/View/Widget/GroupBoxes.cpp index 9225d3f7e74f58104c2e0cd7a0a9057df61ce3ff..f6f452908dcf834b552f510782f68a10dddf9ee9 100644 --- a/GUI/View/Widget/GroupBoxes.cpp +++ b/GUI/View/Widget/GroupBoxes.cpp @@ -21,29 +21,27 @@ #include <QVariant> // ************************************************************************************************ -// class GroupBox +// class HeinzGroupBox // ************************************************************************************************ -GroupBox::GroupBox(const QString& title, QLayout* content_layout, QWidget* parent) - : QGroupBox(parent) +HeinzGroupBox::HeinzGroupBox(const QString& title, QWidget* parent) + : QWidget(parent) { auto* label = new QLabel(this); label->setObjectName("GroupBoxToggler"); label->setText(title); label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); - auto* contentArea = new QWidget(this); - contentArea->setObjectName("ContentArea"); - contentArea->setLayout(content_layout); + m_body = new QWidget(this); + m_body->setObjectName("ContentArea"); // stylesheet -> transparent background - auto* mainLayout = new QVBoxLayout; - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0, 0, 0, 0); - mainLayout->setMenuBar(label); - mainLayout->addWidget(contentArea); + auto* layout = new QVBoxLayout; + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + layout->setMenuBar(label); + layout->addWidget(m_body); - setTitle(""); - setLayout(mainLayout); + setLayout(layout); } // ************************************************************************************************ diff --git a/GUI/View/Widget/GroupBoxes.h b/GUI/View/Widget/GroupBoxes.h index 3e529df66205ee47e8fdad7b17db91a823a89041..c12893a1e0f9ddece49ec3fe10a5dd7ac111b553 100644 --- a/GUI/View/Widget/GroupBoxes.h +++ b/GUI/View/Widget/GroupBoxes.h @@ -24,9 +24,13 @@ class QToolButton; //! A QGroupBox with given title and layout, and some standard styling. -class GroupBox : public QGroupBox { +class HeinzGroupBox : public QWidget { public: - GroupBox(const QString& title, QLayout* content_layout, QWidget* parent); + HeinzGroupBox(const QString& title, QWidget* parent); + QWidget* body() { return m_body; } + +private: + QWidget* m_body; };