bool QLayout::activate() { // Paul: If adding stuff to a QLayout for a widget causes // postEvent(thatWidget, QEvent::LayoutHint), activate() becomes // unnecessary in that case too. invalidateRecursive( this ); if ( !topLevel ) return FALSE; QWidget *mainW = mainWidget(); if ( !mainW ) { #if defined( CHECK_NULL ) qWarning( "QLayout::activate(): %s \"%s\" does not have a " "main widget.", QObject::className(), QObject::name() ); #endif return FALSE; } activated = TRUE; QSize s = mainWidget()->size(); int mbh = 0; #ifndef QT_NO_MENUBAR mbh = menubar && !menubar->isTopLevel() ? menubar->heightForWidth( s.width() ) : 0; #endif int b = marginImpl ? 0 : outsideBorder; setGeometry( QRect( b, mbh + b, s.width() - 2*b, s.height() - mbh - 2*b ) ); if ( frozen ) mainWidget()->setFixedSize( totalSizeHint() ); //### will trigger resize else if ( autoMinimum ) mainWidget()->setMinimumSize( totalMinimumSize() ); //###if ( sizeHint or sizePolicy has changed ) mainWidget()->updateGeometry(); return TRUE; }
int main() { QSize s = totalMinimumSize(); if (s.wd != 100 || s.ht != 200) abort (); }