31 #include <QVBoxLayout> 32 #include <QScrollArea> 40 QVBoxLayout * verticalLayout1 =
new QVBoxLayout(
this);
41 QScrollArea * scrollArea =
new QScrollArea(
this);
42 scrollArea->setWidgetResizable(
true);
43 QWidget * scrollAreaWidgetContent =
new QWidget();
44 scrollAreaWidgetContent->setObjectName(
"area");
45 QVBoxLayout * layout2 =
new QVBoxLayout(scrollAreaWidgetContent);
46 scrollAreaWidgetContent->setLayout(layout2);
47 scrollArea->setWidget(scrollAreaWidgetContent);
49 QCheckBox *
selectAll =
new QCheckBox(
"Select all",
this);
50 connect(selectAll, SIGNAL(toggled(
bool)),
this, SLOT(
selectAll(
bool)));
51 verticalLayout1->addWidget(selectAll);
52 verticalLayout1->addWidget(scrollArea);
73 QWidget * area = this->findChild<QWidget*>(
"area");
74 QVBoxLayout * layout = (QVBoxLayout *)area->layout();
75 QList<QCheckBox*> checkboxes = area->findChildren<QCheckBox*>();
76 while(checkboxes.size() && checkboxes.size() > (int)
_poses.size())
78 delete *checkboxes.begin();
79 checkboxes.erase(checkboxes.begin());
82 for(std::map<int, Transform>::iterator iter=
_poses.begin(); iter!=
_poses.end(); ++iter)
85 if(i >= checkboxes.size())
87 checkboxes.push_back(
new QCheckBox(area));
90 checkboxes[i]->setText(QString(
"%1 (%2)").arg(iter->first).arg(iter->second.prettyPrint().c_str()));
91 checkboxes[i]->setChecked(
_mask.at(iter->first));
94 connect(checkboxes[i], SIGNAL(stateChanged(
int)),
this, SLOT(
signalVisibility()));
95 layout->addWidget(checkboxes[i]);
104 UASSERT(poses.size() == mask.size());
107 if(this->isVisible())
115 std::map<int, Transform> poses;
116 for(std::map<int, Transform>::const_iterator iter=
_poses.begin(); iter!=
_poses.end(); ++iter)
118 if(
_mask.at(iter->first) && iter->first > 0)
128 QCheckBox * check = qobject_cast<QCheckBox*>(sender());
129 _mask.at(check->text().split(
'(').first().toInt()) = check->isChecked();
130 Q_EMIT
visibilityChanged(check->text().split(
'(').first().toInt(), check->isChecked());
135 QWidget * area = this->findChild<QWidget*>(
"area");
136 QList<QCheckBox*> checkboxes = area->findChildren<QCheckBox*>();
137 for(
int i = 0; i<checkboxes.size(); ++i)
139 checkboxes[i]->setChecked(checked);
GLM_FUNC_DECL genIType mask(genIType const &count)
#define UASSERT(condition)
ULogger class and convenient macros.