KDEUI
Go to the documentation of this file.
21 #include <QtCore/QEvent>
22 #include <QtGui/QApplication>
23 #include <QtGui/QHBoxLayout>
24 #include <QtGui/QVBoxLayout>
30 QHBoxLayout* layout =
new QHBoxLayout(
this );
31 layout->setSpacing( 0 );
32 layout->setMargin( 0 );
42 QVBoxLayout* layout =
new QVBoxLayout(
this );
43 layout->setSpacing( 0 );
44 layout->setMargin( 0 );
55 switch ( event->type() ) {
56 case QEvent::ChildAdded:
58 QChildEvent*
childEvent =
static_cast<QChildEvent *
>( event );
61 static_cast<QBoxLayout *
>( layout() )->addWidget( widget );
66 case QEvent::ChildRemoved:
68 QChildEvent*
childEvent =
static_cast<QChildEvent *
>( event );
71 static_cast<QBoxLayout *
>( layout() )->removeWidget( widget );
79 QFrame::childEvent(event);
85 QApplication::sendPostedEvents( that, QEvent::ChildAdded );
87 return QFrame::sizeHint();
93 QApplication::sendPostedEvents( that, QEvent::ChildAdded );
95 return QFrame::minimumSizeHint();
100 layout()->setSpacing( spacing );
110 layout()->setMargin( margin );
KHBox(QWidget *parent=0)
Creates a new hbox.
A container widget which arranges its children horizontally.
virtual QSize sizeHint() const
Calculate the recommended size for this hbox.
virtual void childEvent(QChildEvent *ev)
void setMargin(int margin)
Sets the margin of the hbox.
void setStretchFactor(QWidget *widget, int stretch)
Sets the stretch factor of widget to stretch.
void setSpacing(int space)
Sets the spacing between the child widgets to space.
virtual QSize minimumSizeHint() const
Calculate the recommended minimum size for this hbox.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jan 19 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.