[PyQt] QTabWidget.removeTab() causes segfault

Necoro lists at necoro.eu
Thu May 31 21:17:27 BST 2007


Hi,

I currently switched from PyQt-4.1.1 to PyQt-4.2. Now my application
segfaults on quitting.

In my application I have the following:

class Details:
    def __init__ (self, window, ...):
        window.pkgTab.setHidden(True) # hide the tab
        window.tabWidget.removeTab(0) # remove the tab we just hid

    def update (self):
        # first update -> show
        if self.window.pkgTab.isHidden():
            self.window.tabWidget.insertTab(0, self.window.pkgTab,
"Package")
            self.window.pkgTab.setHidden(False)


Now, if update() is not called, it segfaults on quitting. If it _is_
called, everything works just fine.

I think, that this change may cause the problem :):

2007/03/22 16:08:04 phil
Added /TransferBack/ functionality to QTabWidget.removeTab().


Additionally some background information, as it might matter:
The window passed to Details is a QMainWindow subclass, which is
generated at runtime using a "*.ui"-file. In this ui-file, the tab I am
playing with is already existing - in other words: I have a TabWidget
with some tabs defined in the *.ui. And on startup I remove the first tab.

Regards,
Nec


More information about the PyQt mailing list