Why so many QStyles

Hugo Pereira Da Costa hugo.pereira at free.fr
Thu Oct 2 20:10:05 UTC 2014


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


More information about the Kde-frameworks-devel mailing list