I'm currently watching some videos for learning PyQT.
I wrote some code, which the instructor was going through in the tutorial into my IDE (wing) and run it and it worked fine. Today, I've gone to run it and I'm getting this error:
QWidget: Must construct a QApplication before a QPaintDevice
But nothing's changed (in my code). I've opened the instructor's code (which is pretty much verbatim code) and the same error. But it worked the other day and now it doesn't. What gives? Has someone had the same experience? It's driving me crazy!! I'm running OS X, and writing code in Wing IDE if that's of any relevance.
The code I was trying to run:
import PyQt4.QtCore as qc
import PyQt4.QtGui as qg
class simpleUI(qg.QDialog):
def __init__(self):
qg.QDialog.__init__(self)
self.setWindowTitle('Simple UI')
self.setWindowFlags(qc.Qt.WindowStaysOnTopHint)
self.setModal(False)
self.setFixedHeight(250)
self.setFixedWidth(300)
dialog = simpleUI()
dialog.show()
Help!!!!