SVN commit 777102 by uwolfer: Backport: SVN commit 777098 by uwolfer: Properly initialize the QStyleOptionFrame. That's why this protected function is there in QLineEdit. Fixes margin problems with Oxygen style and works also fine with Plastique. M +2 -5 klineedit.cpp --- branches/KDE/4.0/kdelibs/kdeui/widgets/klineedit.cpp #777101:777102 @@ -1558,12 +1558,9 @@ // qlineedit uses an internal qstyleoption set to figure this out // and then adds a hardcoded 2 pixel interior to that. // probably requires fixes to Qt itself to do this cleanly + // see define horizontalMargin 2 in qlineedit.cpp QStyleOptionFrame opt; - opt.init( this ); - opt.rect = contentsRect(); - opt.lineWidth = hasFrame() ? style()->pixelMetric( QStyle::PM_DefaultFrameWidth ) : 0; - opt.midLineWidth = 0; - opt.state |= QStyle::State_Sunken; + initStyleOption( &opt ); QRect cr = style()->subElementRect( QStyle::SE_LineEditContents, &opt, this ); cr.setLeft( cr.left() + 2 ); cr.setRight( cr.right() - 2 );