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 );
59 if ( childEvent->child()->isWidgetType() ) {
61 static_cast<QBoxLayout *
>( layout() )->addWidget( widget );
66 case QEvent::ChildRemoved:
68 QChildEvent*
childEvent =
static_cast<QChildEvent *
>( event );
69 if ( childEvent->child()->isWidgetType() ) {
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.
void setMargin(int margin)
Sets the margin of the hbox.
virtual void childEvent(QChildEvent *ev)
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 sizeHint() const
Calculate the recommended size for this hbox.
virtual QSize minimumSizeHint() const
Calculate the recommended minimum size for this hbox.
A container widget which arranges its children horizontally.
This file is part of the KDE documentation.
Documentation copyright © 1996-2017 The KDE developers.
Generated on Wed May 10 2017 11:02:02 by
doxygen 1.8.11 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.