I’m a non-blender user but im going to start doing UI work in it with pyqt. I compiled pyqt against python 3.2 and dropped it in the blender folder. I can bring up a qt widget with the “system” method but ofc then its not parented to the window and it will close the main app on close.
So, Im looking into reproducing the trusty getMayaWindow(). I had a look at some source for the softimage blur pyqt plugin and it does the following. However, my main question is:
Do i really need to go through the trouble of doing all this to get the ptr to themain window since I have all the source? Should i look harder at the source or should I try to imitate blur? Is doing this C step the only way to get a main window?
I went onto the blender forums and didnt find anything - its weird. Its so much better for gui work than regular python. I added it in in about an hour without trouble except for this ptr issue.
[QUOTE=btribble;18456]When you think PyQt. Think Nathan Horne.[/QUOTE]
Thanks for the link but that eample is dependant on using the maya-specific method MQtUtil to get the main window. Im asking about whether I need to reproduce it in C as well or use a “shortcut” instead since I have access to all the code.
Might be best to ask on the blender dev forum.
But as I understand it, Blender doesn’t use a Qt window (rather they use their own framework)
Essentially all you need is for Blender to give you back a window memory id, but that still may not be enough.
Also I find it weird that you compiled Qt against Py3.2
I thought blender like most apps was in a py2.x version
Blender doesn’t use Qt. You can make PyQt windows with Blender because it uses python but the interface itself is not written with Qt.
I’m not sure if there’s a way to deal with the window-parenting issues in this case (ie, your tool will go behind the main blender window, probably, but they may have a workaround for this).