If I run this code:
#!/usr/local/bin/ python3
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Window(QMainWindow):
def
This problem also occurs in PyQT5 when you run a continuous thread and close the mainwindow/dialog without closing thread first but in background the thread is processing. When you again open the window the second thread generated and delete the pre-existed widgets. You need to exit the thread first before re-run it. You can exit the thread by put the check on visibility of any widget in the mainwindow/dialog
**if self.widget.isVisible() == False:
break**