[PyKDE] SegFault at exit using QStatusBar

Phil Thompson phil at river-bank.demon.co.uk
Thu Apr 18 14:21:21 BST 2002


Noah Spies wrote:
> 
> Hi,
> I've been attempting to use QStatusBar in my application, and it seems
> to work just fine, until I quit the application, at which point it
> seg-faults.  Everything else apparently runs perfectly well, and I can
> see the message in the statusbar.
> 
> Did I do something wrong?  I'm using PyQt/SIP 3.1 and Qt 3.0.3.  The
> code that crashes is included below.
> 
> Noah
> 
> #!/usr/bin/env python
> 
> import sys
> from qt import *
> 
> class MainWindow(QWidget):
>     def __init__(self, *args):
>         apply(QWidget.__init__, (self,) + args)
> 
>         self.status_bar = QStatusBar(self)
>         self.status_bar.message("HI!")
> 
> def run_main(alignment=None):
>     application = QApplication(sys.argv)
> 
>     main_window = MainWindow()
>     main_window.show()
> 
>     application.connect(application, SIGNAL('lastWindowClosed()'),
>                         application, SLOT('quit()'))
>     application.exec_loop()
> 
> if __name__ == "__main__":
>     run_main()

Works fine for me with v3.2rc1.

Phil





More information about the PyQt mailing list