Yeah this is one %!&#! of a headache.
I’d like to just mention Qt.py <https://github.com/mottosso/Qt.py>, which
is an open source project Marcus Ottosson and myself started because of
this mess as well as PySide will disappear alltogether the day Nuke stops
using Qt4 and begins using Qt5.
When that happens, PySide2 will most likely get bundled with Nuke and all
previous PySide/PyQt4 scripts will stop working.
So, our solution is you don’t import PySide at all. Instead you import our
shim instead of a specific Python binding. This simple example code works
in Python 2 & 3 with either PySide, PyQt4, PySide2 or PyQt5:
import sysfrom Qt import QtWidgets
app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello World")
button.show()
app.exec_()
To help get you started, here are two blog posts which outline how to use
Qt.py:
-
Dealing with Maya 2017 and PySide2
<https://fredrikaverpil.github.io/2016/07/25/dealing-with-maya-2017-and-pyside2/>
-
Developing with Qt.py
<https://fredrikaverpil.github.io/2016/07/25/developing-with-qt-py/>
We’d love to hear what you think about this! :)
Regards,
Fredrik
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python