Why so many QStyles

Aleix Pol aleixpol at kde.org
Thu Oct 2 22:09:11 UTC 2014


On Thu, Oct 2, 2014 at 10:10 PM, Hugo Pereira Da Costa <hugo.pereira at free.fr
> wrote:

> hi all,
>
> I guess its a question to Qt experts or possibly low level KF5 experts.
>
> When comparing debugging outputs when running app + style against Qt4 and
> Qt5, I've noticed the following significant difference.
> In Qt4, as far as I can tell, QStyle was only instanciated one per QApp,
> and deleted at the end.
> In Qt5 this seems not to be true anymore and I've seen up to 6 QStyle
> running concurently for a single Kate Window, increasing to 13 when opening
> 'open file' dialog, decreasing back to 6 when closing it, etc.
> Is this a known feature ? Will this stay ?
>
> (I'm running a rather old checkout of Qt-5.4)
>
> If yes, there need to be some design change in Oxygen (as well as in
> breeze), to use singletons rather than QStyle's QObject's children for many
> things, with regard for instance caching, configuration, and even possibly
> even filters, otherwise I foresee quite some overhead ...
>
> Information welcome,
>
> Best regards,
>
> Hugo
>

Hi Hugo,
Thanks for looking into this! :)

I would recommend to start by adding a breakpoint on the style's
constructor to see who is calling it. To me it sounds like a bug in Qt, but
it needs investigation.

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141003/878fa7fd/attachment.html>


More information about the Kde-frameworks-devel mailing list