[PyQt] Sefgault on exit with QThread

Nate C nate1001 at gmail.com
Fri Jul 16 03:56:05 BST 2010


I just switched this to pure Qt without plasma and it now works.

from PyQt4.QtGui import *
from PyQt4.QtCore import *

class Thread(QThread):
    def __init__(self, parent=None):
        QThread.__init__(self, parent)

    def run(self):
        return

class Widget(QMainWindow):
    def __init__(self, parent=None):
        QMainWindow.__init__(self,parent)

    def init(self):
        self.worker = Thread()
        self.worker.start()

import sys
app=QApplication(sys.argv)
app.connect(app, SIGNAL("lastWindowClosed()") , app , SLOT("quit()"))
w = Widget()
w.show()
app.exec_()


More information about the PyQt mailing list