I am writing this post because I’ve seen virtually no discussion of it on the internet after extensive searching.
We have some gui code written in PyQt for our Maya 2011 tools. Obviously these can’t be used directly in Maya 2015, so I have the option of either compiling PyQt4 myself or converting the code to PySide. Now I’ve spent a few hours trying to compile these, but Autodesk’s instructions are terrible and their example code is set up to use an older version of Visual Studio and PyQt than they tell you to use in the introduction. Is it worth all the hassle or should I just convert our code to PySide which comes bundled with Maya 2015? The later option sounds more appealing to me.
Side note: I have also tried downloading the latest version of PyQt4 (PyQt4-4.11.3-gpl-Py2.7-Qt4.8.6-x64) from riverbankcomputing.com and moved the PyQt folder from site-packages to Maya 2015 site packages folder, and it imported fine. So why is autodesk telling us we have to compile it ourselves? I have yet to try it with our tools, so I don’t know if it actually works well yet.
Seconded. PySide is where the inertia is headed. The only catch is that PySide doesn’t support the loadui() command well, and it is probably a better choice to compile your .ui files to .py files using pysideuic. The good news is that without the need to parse your .ui files every time they are opened, everything loads faster.
EDIT: BTW, the “syntactic changes” mentioned by rgkovach123 are largely improvements, such as the consistent use of native Python strings where previously you had to cast to a QT string type.
Cool, this seems to work well. I will need to recompile the ui files, but for now editing them manually worked just to get everything loaded.
Just wish I had thought of asking about this before installing Visual Studio!
[QUOTE=btribble;26342]Seconded. PySide is where the inertia is headed. The only catch is that PySide doesn’t support the loadui() command well, and it is probably a better choice to compile your .ui files to .py files using pysideuic.[/QUOTE]
It is very possible to load .ui files in PySide too though. As for the question, yes PySide.
[QUOTE=instinct-vfx;26346]It is very possible to load .ui files in PySide too though. As for the question, yes PySide.[/QUOTE]
You can load the contents of a page from a .ui file, but you can’t derive an instance of an entire window. At least, you can’t do it in the same way that we were doing it with PyQT.
[QUOTE=instinct-vfx;26360]Am a tad off the shelf it seems. I see what you mean now and you are of course right. Would something like this work? (Have not looked at it really) {snip} [/QUOTE]
Yup, this exactly. You have to extend PySide to add support for PyQT style loadui behavior. I haven’t been able to make this work reliably, and with the speed improvements of the pysideuic compiled code, this is why I recommend that approach. Rather than extend the loadui command, I’d rather wrap the import command with code that does a datestamp check and recompiles from the .ui file if I really want something like the PyQT setup.
we had to write our own loader that uses a combination of pysideuic.Compiler.compiler and StringIO. It works exactly like PyQt.
I believe portions of it were cobbled together from various Stack Overflow and blog posts, i’ll see if I can track them down (I didn’t personally write the function)…
[QUOTE=btribble;26362]Yup, this exactly. You have to extend PySide to add support for PyQT style loadui behavior. I haven’t been able to make this work reliably, and with the speed improvements of the pysideuic compiled code, this is why I recommend that approach. Rather than extend the loadui command, I’d rather wrap the import command with code that does a datestamp check and recompiles from the .ui file if I really want something like the PyQT setup.[/QUOTE]
And then there’s Rob’s recent post and it haed me wonder and question some of my tools hehe