QLayout::QLayout( QWidget *parent, int border, int space, const char *name ) : QObject( parent, name ) { init(); if ( parent ) { if ( parent->layout() ) { qWarning( "QLayout \"%s\" added to %s \"%s\"," " which already had a layout.", QObject::name(), parent->className(), parent->name() ); parent->removeChild( this ); } else { topLevel = TRUE; if ( parent->isTopLevel() ) autoMinimum = TRUE; parent->installEventFilter( this ); setWidgetLayout( parent, this ); } } outsideBorder = border; if ( space < 0 ) insideSpacing = border; else insideSpacing = space; installEventFilter( this );//###binary compatibility. }
Results::Results(QWidget *parent) : QWidget(parent) { createWidgetItems(); setWidgetLayout(); createConnections(); }
QLayout::~QLayout() { //note that this function may be called during the QObject destructor, //when the parent no longer is a QWidget. if ( isTopLevel() && parent() && parent()->isWidgetType() && ((QWidget*)parent())->layout() == this ) setWidgetLayout( (QWidget*)parent(), 0 ); }
mainView::mainView(QWidget *parent) : QWidget(parent), timer(new QTimer(this)) { setWindowTitle(tr("Life on Qt4.")); //setFixedSize(550, 420); timer->setInterval(250); initWidgets(); setWidgetLayout(); setConnections(); }
pluginFieldInt::pluginFieldInt(pluginField *parent) : pluginField(parent) { fieldContent = new QSpinBox() ; QHBoxLayout *tmpLayout = new QHBoxLayout() ; tmpLayout->addWidget(fieldContent) ; tmpLayout->addStretch() ; tmpLayout->setContentsMargins(0,0,0,0) ; setWidgetLayout(tmpLayout) ; }
pluginFieldBool::pluginFieldBool(pluginField *parent) : pluginField(parent) { contentYes = new QRadioButton(tr("Yes")) ; contentNo = new QRadioButton(tr("No")) ; QHBoxLayout *tmpLayout = new QHBoxLayout() ; tmpLayout->addWidget(contentYes) ; tmpLayout->addWidget(contentNo) ; tmpLayout->addStretch() ; tmpLayout->setContentsMargins(0,0,0,0) ; setWidgetLayout(tmpLayout) ; }
TheBestList::TheBestList(QWidget *parent) { createItems(); setWidgetLayout(); createConnections(); }