[PyQt] QMainWindow bug?

Vicent Mas uvemas at gmail.com
Wed Jan 19 09:46:19 GMT 2011


2011/1/19 Antonio Valentino <antonio.valentino at tiscali.it>:
> Hi Vicent,
>
> Il giorno Tue, 18 Jan 2011 19:32:57 +0000
> Vicent Mas <uvemas at gmail.com> ha scritto:
>
>> Hi,
>>
>> it seems there is a bug in QMainWindow.createPopupMenu. In my system
>> (Windows XP, Python 2.6, PyQt 4.8.2 installed using the Windows
>> installer), when I run the attached script and close the created
>> QMainWindow, an error dialog appears saying that python.exe has found
>> a problem and must be closed.
>>
>> Could someone confirm this behavior? Thanks.
>
> Segmentation fault on:
>
> GNU/Linux x86_64 2.6.35 (Ubuntu 10.10)
> Python 2.6.6
> PyQt4 4.7.4
> Qt4 4.7.0
>
>
> No problem if I add
>
> del toolbars_submenu
>
> at the very and of the program
> It seems that having around references to objects that are child of the
> mainwin triggers the problem.
>
> ciao
>
> --
> Antonio Valentino
>

Hi,

Antonio, your workaround works here. Thanks a lot. Anyway I think the
current behavior is buggy. Even if I set the WA_DeleteOnClose flag on
the main window (which I expected to delete the main window and its
children when the window is closed) the script crashes if I don't
apply your workaround.

Vicent

-- 
Share what you know, learn what you don't.


More information about the PyQt mailing list