I'm not sure what you don't have as a windows user... but if you are using a standard python intepreter in a shell to test this, then you must create a QApplication before creating widgets
app = QtGui.QApplication([]) In my tutorials when I use ipython --gui, it will create one for you and start the event loop. In Maya, a QApplication is also already created. - justin On Mar 13, 2014 7:38 AM, <[email protected]> wrote: > I am a windows 7 64 bit user, using Python 2.7.3 and am following the > cmivfx tutorial:Pyqt4andMaya > > When I enter the code: > > from PyQt4 import QtGui > widget = QtGui.QWidget() > widget.resize(400,300) > widget.show() > widget.raise_() > #button = QTGui.QpushButton('Button') > #button.show() > #button.raise_() > button = QtGui.QPushButton('Button', parent = widget) > button.show() > button.move(30, 40) > > I also get the error: > > QWidget: Must construct a QApplication before a QPaintDevice > > > As the tut is on a mac, I have noticed a few things that I do not have as > a windows user so what am I doing wrong? > > I am not using iPython. > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/4ea09bcd-ab56-41b0-b559-6fff02376f95%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1cd-zBXee%3DAtf%2Bwzh95AmSkRi5MCB%2BN%2BjG4835F1Tung%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
