Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
tools
DDqt
src
DDqtControls.cpp
Go to the documentation of this file.
1
/* This file is part of MoDELib, distributed under GNU GPL v2. */
2
#include <
DDqtControls.h
>
3
4
namespace
model::controls
5
{
6
7
auto
GroupBox::showEvent
(QShowEvent *
event
) ->
void
8
{
9
if
(isCheckable() && !body && layout())
10
{
11
body =
new
QWidget(
this
);
12
body->setLayout(layout());
13
auto
*outer =
new
QVBoxLayout(
this
);
14
outer->setContentsMargins(0, 0, 0, 0);
15
outer->setSpacing(0);
16
outer->addWidget(body);
17
body->setVisible(isChecked());
18
}
19
QGroupBox::showEvent(
event
);
20
}
21
22
GroupBox::GroupBox
(
const
QString &title, QWidget *
parent
) : QGroupBox(title,
parent
)
23
{
24
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
25
connect(
this
, &QGroupBox::toggled,
this
,
26
[
this
](
bool
checked)
27
{
28
if
(body)
29
{
30
body->setVisible(checked);
31
updateGeometry();
32
}
33
});
34
}
35
}
// namespace model::controls
DDqtControls.h
model::controls::GroupBox::showEvent
void showEvent(QShowEvent *event) override
Definition
DDqtControls.cpp:7
model::controls::GroupBox::GroupBox
GroupBox(const QString &title, QWidget *parent=nullptr)
Definition
DDqtControls.cpp:22
model::controls
Definition
DDqtControls.h:12
event
Definition
triangle.cpp:582
parent
int parent
Definition
triangle.cpp:10285
Generated by
1.15.0