QFrame::QFrame( QWidget *parent, const char *name, WFlags f )
    : QWidget( parent, name, f )
{
    frect  = QRect( 0, 0, 0, 0 );
    fstyle = NoFrame | Plain;
    lwidth = 1;
    mwidth = 0;
    mlwidth = 0;
    updateFrameWidth();
}
void QFrame::setFrameStyle( int style )
{
    if ( !testWState( WState_OwnSizePolicy ) ) {
	switch ( style & MShape ) {
	case HLine:
	    setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
	    break;
	case VLine:
	    setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum );
	    break;
	default:
	    if ( (fstyle & MShape) == HLine || (fstyle & MShape) == VLine)
		setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
	}
	clearWState( WState_OwnSizePolicy );
    }
    fstyle = (short)style;
    updateFrameWidth( TRUE );
}
Beispiel #3
0
void QFrame::setFrameStyle( int style )
{
    //   If this is a line, it may stretch in the direction of the
    //   line, but it is fixed in the other direction. If this is a
    //   normal frame, use QWidget's default behavior.
    switch (style & MShape) {
    case HLine:
	setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
	break;
    case VLine:
	setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ) );
	break;
    default:
	// only reset if it was hline or vline
	if ( (fstyle & MShape) == HLine || (fstyle & MShape) == VLine ) 
	    setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
    }
    fstyle = (short)style;
    updateFrameWidth();
}
Beispiel #4
0
void QFrame::setMargin( int w )
{
    mwidth = (short)w;
    updateFrameWidth();
}
Beispiel #5
0
void QFrame::setMidLineWidth( int w )
{
    mlwidth = (short)w;
    updateFrameWidth();
}
/*!\reimp
 */
void  QFrame::styleChange( QStyle& old )
{
    updateFrameWidth( TRUE );
    QWidget::styleChange( old );
}