[PATCH] Fix infinite recursion in KdeuiWidgetsProxyStyle

David Faure faure at kde.org
Thu Jun 12 22:59:48 BST 2008

On Thursday 12 June 2008, Olivier Goffart wrote:
> Le mercredi 11 juin 2008, Aurélien Gâteau a écrit :
> > Hello,
> >
> > You (may) know that KLineEdit uses KdeuiWidgetsProxyStyle to define the
> > right margin necessary to show the "clear" button. To do so it uses a
> > proxy of QStyle(): KdeuiWidgetsProxyStyle.
> >
> > This causes infinite recursion when the KLineEdit parent uses
> > QStyleSheetStyle because also acts as a proxy to the "base" style.
> If fact, it should not recurse infinitively.
> Let's say you have QStyleSheetStyle which is the proxy for the OriginalStyle
> Then you add KdeuiWidgetsProxyStyle. which will be the proxy of the old 
> QStyleSheetStyle.  But a new QStyleSheetStyle will be created on top.
> So we will have
> QStyleSheetStyle -> KdeuiWidgetsProxyStyle -> QStyleSheetStyle -> OriginalStyl
> e  (where -> mean "is a proxy for")
> Now, maybe there is a bug making that some style may be deleted while they 
> should not.
> I'll look into that.

As I said, I think it comes from parent->parentWidget()->style().
This is where it recurses: we're looking at the style for _another_ widget than the lineedit!

So it can go    QStyleSheetStyle -> KdeuiWidgetsProxyStyle -> _same_ QStyleSheetStyle, but for the parent widget,
when that QStyleSheetStyle was applied to the whole application.
See my post for more info :)

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list