#include <rwidgetutils.h>
An Horizontal widget to host children widgets
Definition at line 82 of file rwidgetutils.h.
◆ RHBox() [1/2]
| KDcrawIface::RHBox::RHBox |
( |
QWidget *const | parent = 0 | ) |
|
|
explicit |
Definition at line 117 of file rwidgetutils.cpp.
118 : QFrame(parent)
119{
120 QHBoxLayout*
const layout =
new QHBoxLayout(
this);
122 layout->setContentsMargins(0, 0, 0, 0);
123}
◆ ~RHBox()
| KDcrawIface::RHBox::~RHBox |
( |
| ) |
|
|
override |
◆ RHBox() [2/2]
| KDcrawIface::RHBox::RHBox |
( |
bool | vertical, |
|
|
QWidget *const | parent ) |
|
protected |
Definition at line 125 of file rwidgetutils.cpp.
126 : QFrame(parent)
127{
128 QVBoxLayout*
const layout =
new QVBoxLayout(
this);
130 layout->setContentsMargins(0, 0, 0, 0);
131}
◆ childEvent()
| void KDcrawIface::RHBox::childEvent |
( |
QChildEvent * | e | ) |
|
|
overrideprotected |
Definition at line 137 of file rwidgetutils.cpp.
138{
139 switch (e->type())
140 {
141 case QEvent::ChildAdded:
142 {
143 QChildEvent* const ce = static_cast<QChildEvent*>(e);
144
145 if (ce->child()->isWidgetType())
146 {
147 QWidget*
const w =
static_cast<QWidget*
>(ce->child());
148 static_cast<QBoxLayout*
>(
layout())->addWidget(w);
149 }
150
151 break;
152 }
153
154 case QEvent::ChildRemoved:
155 {
156 QChildEvent* const ce = static_cast<QChildEvent*>(e);
157
158 if (ce->child()->isWidgetType())
159 {
160 QWidget*
const w =
static_cast<QWidget*
>(ce->child());
161 static_cast<QBoxLayout*
>(
layout())->removeWidget(w);
162 }
163
164 break;
165 }
166
167 default:
168 break;
169 }
170
171 QFrame::childEvent(e);
172}
◆ minimumSizeHint()
| QSize KDcrawIface::RHBox::minimumSizeHint |
( |
| ) |
const |
|
override |
Definition at line 182 of file rwidgetutils.cpp.
183{
185 QApplication::sendPostedEvents(b, QEvent::ChildAdded );
186
187 return QFrame::minimumSizeHint();
188}
RHBox(QWidget *const parent=0)
◆ setMargin()
| void KDcrawIface::RHBox::setMargin |
( |
int | margin | ) |
|
◆ setSpacing()
| void KDcrawIface::RHBox::setSpacing |
( |
int | space | ) |
|
◆ setStretchFactor()
| void KDcrawIface::RHBox::setStretchFactor |
( |
QWidget *const | widget, |
|
|
int | stretch ) |
◆ sizeHint()
| QSize KDcrawIface::RHBox::sizeHint |
( |
| ) |
const |
|
override |
Definition at line 174 of file rwidgetutils.cpp.
175{
177 QApplication::sendPostedEvents(b, QEvent::ChildAdded);
178
179 return QFrame::sizeHint();
180}
The documentation for this class was generated from the following files: