2. 63 # import PyQt4 unconfigured
ImportError: Cannot import PySide or PyQt4
--
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 python_inside_m...@googlegroups.com.
To post to this group, send email to python_in...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
from PyQt4 import QtGui
widget = QtGui.QWidget()
widget.resize(400,300)
widget.show()
widget.raise_()
button = QtGui.QPushButton("Button")
button.show()
button.raise_()
button.deleteLater()
button = QtGui.QPushButton("button",parent=widget)
button.show()
button.raise_()
button.pos()
button.move(30,40)
widget.deleteLater
when I typed in the second line "widget = QtGui.QWidget()" in ipython
it returned me like downbelow:
QWidget: Must construct a QApplication before a QPaintDevice
Abort trap: 6
still I can work it out in mayapython.
As a freshman, I searched the web for solution, there are many suggestion about "QWidget: Must construct a QApplication before a QPaintDevice", but still can't I work it out.
Would you please give me some advise.
thank you
sincerely li
20130715
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.
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
--
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 python_inside_m...@googlegroups.com.
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.
--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.
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/L-UdL6sqByM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
Hey there,
Have you come across this yet from an earlier post?
http://vimeo.com/40380911
Tim Withers did a node based interface in Qt to control particle sims. I had helped him along with it as part of his masters thesis. It uses svg for the node graphics. And he posted the source here:
https://github.com/drumboy354/MayaNodeInterface
Getting into QGraphics is probably the second hardest part of Qt, next to the model/view system. But it has a lot of concepts you probably already know like the transforms and scene graph. The painting and parent child bounds stuff can be a little tricky though. Eventually it clicks though and ends up being pretty fast.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJ7Ouxc%3DD7ngEP94e8X-sMktg5Yquqgb-D-qgdDwKZSAwa4f2g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0C0-7nMdOTxq8aZjnk81kVH35epDQaQgJ8h7dWsD1Ekg%40mail.gmail.com.