-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparamgroup.cpp
More file actions
24 lines (24 loc) · 758 Bytes
/
paramgroup.cpp
File metadata and controls
24 lines (24 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "paramgroup.h"
ParamGroup::ParamGroup(QString name,QWidget*parent):QGroupBox(name,parent){
QLayout*outer=new QVBoxLayout(this);
outer->setContentsMargins(0,0,0,0);
QWidget*frame=new QWidget(this);
outer->addWidget(frame);
frame->setLayout(layout);
layout->addLayout(line);
setStyleSheet("font-weight:bold");
frame->setStyleSheet("font-weight:normal");
setCheckable(true);
connect(this,&QGroupBox::toggled,frame,&QWidget::setVisible);
}
void ParamGroup::enable(){
for(auto param:*this)param->setEnabled(true);
}
void ParamGroup::disable(){
for(auto param:*this)param->setEnabled(false);
}
void ParamGroup::add(Param*param,bool inlined){
if(!inlined)layout->addLayout(line=new QHBoxLayout());
line->addWidget(param);
push_back(param);
}