Skip to content
Snippets Groups Projects
Commit 95a8ab7c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

CollapsibleGroupBox + c'tor w/o title

parent 2a8ca1d9
No related branches found
No related tags found
1 merge request!2387unify code for list views
......@@ -30,7 +30,7 @@
#include <QPushButton>
LayerForm::LayerForm(QWidget* parent, LayerItem* layerItem, SampleEditorController* ec)
: CollapsibleGroupBox(layerItem->layerName(), parent, layerItem->expandLayer)
: CollapsibleGroupBox(parent, layerItem->expandLayer)
, m_layout(new HeinzFormLayout(ec))
, m_layer(layerItem)
, m_ec(ec)
......
......@@ -43,7 +43,7 @@ StaticGroupBox::StaticGroupBox(const QString& title, QWidget* parent)
// class CollapsibleGroupBox
// ************************************************************************************************
CollapsibleGroupBox::CollapsibleGroupBox(const QString& title, QWidget* parent, bool& expanded)
CollapsibleGroupBox::CollapsibleGroupBox(QWidget* parent, bool& expanded)
: QssWidget(parent)
, m_title_widget(new QWidget)
, m_title_layout(new QHBoxLayout(m_title_widget))
......@@ -68,7 +68,6 @@ CollapsibleGroupBox::CollapsibleGroupBox(const QString& title, QWidget* parent,
m_toggle_button->setObjectName("GroupBoxToggler");
m_toggle_button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
m_toggle_button->setCheckable(true);
m_toggle_button->setText(title);
m_toggle_button->setArrowType(Qt::ArrowType::DownArrow);
m_toggle_button->setChecked(expanded);
m_toggle_button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
......@@ -87,6 +86,12 @@ CollapsibleGroupBox::CollapsibleGroupBox(const QString& title, QWidget* parent,
});
}
CollapsibleGroupBox::CollapsibleGroupBox(const QString& title, QWidget* parent, bool& expanded)
: CollapsibleGroupBox(parent, expanded)
{
setTitle(title);
}
void CollapsibleGroupBox::setTitle(const QString& title)
{
m_toggle_button->setText(title);
......
......@@ -39,6 +39,7 @@ private:
class CollapsibleGroupBox : public QssWidget {
Q_OBJECT
public:
CollapsibleGroupBox(QWidget* parent, bool& expanded);
CollapsibleGroupBox(const QString& title, QWidget* parent, bool& expanded);
QWidget* body() { return m_body; }
void setTitle(const QString& title);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment