[PyKDE] Segmentation fault with QTabBar/QTab

Thierry Jouve jouve at esrf.fr
Tue Jun 11 09:00:00 BST 2002


Hi,

   same thing for me, using PyQt 3.1, Qt 3.0.2, python 2.1.1

Regards,

--
   Thierry

"Kaercher, Joerg" wrote:
> 
> Hi,
> 
> I am trying to use the QTabBar/QTab classes and get a segmentation fault
> when a tab is removed from the bar. I found a message in the PyKDE archive
> that mentions that on the C++ level QTabBar::removeTab() calls the
> destructor for the QTab object. Is it possible that the garbage collector in
> Python tries to do the same and thereby causes the segementation fault? Any
> ideas? (I am using PyQt 3.2.4 and Qt 3.0.4 under Linux)
> 
> Thanks.
> 
> Joerg
> 
> Here is a short sample program that demonstrates the problem. The second
> setNumTabs() call crashes the program.
> 
> import qt
> import sys
> 
> class TabBar(qt.QTabBar):
>     def clear(self):
>         for n in range(self.count()):
>             self.removeTab(self.tab(n))
>     def setNumTabs(self,num):
>         self.clear()
>         for n in range(num):
>             self.insertTab(qt.QTab('%d'%(n+1)),n)
> 
> a=qt.QApplication(sys.argv)
> 
> w=TabBar()
> w.setNumTabs(5)
> w.setNumTabs(7)
> 
> a.setMainWidget(w)
> w.show()
> a.exec_loop()
> 
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.gmd.de
> http://mats.gmd.de/mailman/listinfo/pykde

--
   Thierry JOUVE

   BLISS GROUP - ESRF
   Mail : jouve at esrf.fr, Office : 155b, Tel : 29-46




More information about the PyQt mailing list