[PyQt] Crash in QDockWidget::initStyleOption

Phil Thompson phil at riverbankcomputing.com
Sun Mar 30 14:56:35 BST 2014


On 30-03-2014 11:13 am, Dmitry Shachnev wrote:
> Hi Thomi,
>
> I recommend you to keep a reference to objects you create (like
> creating them not as local variables, but as object attributes).

Not an issue in this case as the QMainWindow takes ownership of a 
QDockWidget.

> In any case, I am forwarding your message to PyQt mailing list in 
> case
> someone can solve your problem. Dear mailing list readers: please see
> the bug report below and attached test case there for details of the
> problem.

It's not a bug - you just can't do what you want to. Qt uses an 
internal class as the layout for a QDockWidget. It assumes (and doesn't 
check) that its layout is a valid instance of that class.

Phil

> I have also managed to get a backtrace with Python 3.4 and Qt/PyQt
> 5.2.1, and attached it. (I also highly recommend you to use
> PyQt5/Python3 instead of PyQt4/Python2). The test script I used
> (corresponding to your strategy 2) is also attached.
>
> --
> Dmitry Shachnev
>
> ---------- Forwarded message ----------
> From: Thomi Richards <thomi.richards at canonical.com>
> Date: Fri, Mar 28, 2014 at 11:53 PM
> Subject: PyQt4 bindings
> To: mitya57 at gmail.com
>
> Hi,
>
> Do you look after the PyQt4 bindings? I notice your email in the
> changelog, so I'm hoping you can point me in the right direction. I
> ran into this issue today:
>
> https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/1298767
>
> ...and I'd like to know who I should be talking to to get that
> escalated, and hopefully fixed. Any thoughts?
>
> Cheers,
>
> --
> Thomi Richards
> thomi.richards at canonical.com



More information about the PyQt mailing list