[PyKDE] QStyleFactory and setStyle

Phil Thompson phil at riverbankcomputing.co.uk
Wed Oct 15 09:15:01 BST 2003

On Wednesday 15 October 2003 3:13 am, Tuvi, Selim wrote:
>   Before I report it to Trolltech I wanted to get your feedback on this
> problem. I have a preference option in my application to set the style.
> When the application initially loads it reads the style preference from the
> configuration file and sets the style. This works fine, but if the user
> tries to change it through the preferences the application crashes. This is
> the PyQt code I use to set the style:
> QApplication.setStyle(QStyleFactory.create(style))
> And this is the error I get:
> ASSERT: "parent() && parent()->isWidgetType()" in
> kernel\qabstractlayout.cpp (777)
> Note that it doesn't happen everytime. It seems like it is dependent on the
> font that is being used. In the case that is crashing I have and Arial,
> 10pt, Bold font and I am trying to switch from CDE style to Windows XP
> style.

I would hope that that would work. There are potential reference count issues 
but the .sip files contain the relevant /Transfer/ and /Factory/ flags that 
should deal with this.


More information about the PyQt mailing list