[PyQt] Error while running PyQt programs

Phil Thompson phil at riverbankcomputing.com
Sat Aug 21 11:28:28 BST 2010


On Fri, 20 Aug 2010 20:38:30 +0530, Vikas Mahajan
<vikas.mahajan12 at gmail.com> wrote:
> Hello to all.
> I have compiled python-2.6.5, qt-4.6.3 and PyQt-x11-gpl-4.7.4 on my
> RHEL5 linux machine. I am trying to run any PyQt program, program
> exists with Error: "Segmentation fault".
> Please tell me the reason of this error and how can I overcome from this
> error.
> 
> Thanks.
> 
> Below is the contents of sample files used by me:

...

> File start.py-:
> 
> import sys
> from PyQt4 import QtCore, QtGui
> from testwin import Ui_MainWindow
> 
> class StartQT4(QtGui.QMainWindow):
                       ^^^^^^^^^^^

>     def __init__(self, parent=None):
>         QtGui.QWidget.__init__(self, parent)
                ^^^^^^^

>         self.ui = Ui_MainWindow()
>         self.ui.setupUi(self)
> 
> 
> if __name__ == "__main__":
>     app = QtGui.QApplication(sys.argv)
>     myapp = StartQT4()
>     myapp.show()
>     sys.exit(app.exec_())

You might want to fix the above problem first.

Phil


More information about the PyQt mailing list