[PyQt] Help understanding a backtrace

Phil Thompson phil at riverbankcomputing.com
Mon Jan 30 12:22:35 GMT 2012


On Mon, 30 Jan 2012 17:43:30 +0530, Kovid Goyal <kovid at kovidgoyal.net>
wrote:
> I was able to trace the python code that is triggering the assert. 
> 
> Basically, it is the following sequence:
> 
> view = self.parent() 
> At this point view is a subclass of QMainWindow and view.parent()
returns
> None
> Calling view.size() causes the assert to be triggered. Interestingly the
> assert
> is only triggered the second time this code is run, which tells me that
> probably the underlying Qt object corresponding to view has been
deleted.
> view
> is the main window of the application, there is reference to it kept at
the
> python level.
> 
> Note that this is only one instance where the assert is triggered, I am
> fairly
> certain that there will be several unrelated code paths throughout
calibre
> that
> will trigger it, given the various crashes I have experienced.
> 
> Reading the SIP changelog, one thing of note: The QMainWindow subclass
has
> multiple inheritance. It is defined as
> 
> class EbookViewer(MainWindow, Ui_EbookViewer):
> 
> where Ui_EbookViewer comes from a compiled .ui file and MainWindow is a
> simple
> subclass of QMainWindow. The definition of EbookViewer is here:
>
http://bazaar.launchpad.net/~kovid/calibre/trunk/view/head:/src/calibre/gui2/viewer/main.py#L171
> and the MainWindow class is:
>
http://bazaar.launchpad.net/~kovid/calibre/trunk/view/head:/src/calibre/gui2/main_window.py#L90
> 
> Let me know if there's anything else I can do.

Try the current tip of the 4.13-maint branch without any additional
changes...

hg pull -u

Phil


More information about the PyQt mailing list