[PyQt] [Bug report] PyQt5 doesn't work properly with centralWidget with layout, window not shown but produces lots of errors (flanker017)

David Cortesi davecortesi at gmail.com
Thu Apr 9 15:59:56 BST 2015


I recently encountered a very similar problem running PyQt5.4.1 on Ubunut
14.10. First comes a a blizzard of these messages,


> > (python:22792): Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion
> > `GTK_IS_WIDGET (widget)' failed
>
>
 followed by a steady stream of errors from QPainter that continue until
the app is killed. In my case, there were graphic artifacts on the screen,
a giant menu-bar and comet-trails of pixels if I moved the window.

If you search on that message text you will find many people having similar
problems. They seem to relate to the use of the GTK, and one way to get rid
of them is to make Qt use something else. I put the following code at the
start of my app and the problem vanished:

    args = []
    if sys.platform == 'linux' :
        args = ['','-style','Cleanlooks']
    app = QApplication(args)

This tells Qt to use the "Cleanlooks" graphic template. You could also use
"Fusion".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150409/6557c961/attachment.html>


More information about the PyQt mailing list