On Monday 27 June 2011 04:31:00 Carlo Giesa wrote: > Hi there! > > I would like to use Pyside inside Maya, a 3D package from Autodesk. > I could compile and even create my first little "Hello World!" window > without too much problems. :) > But when I create a window with Pyside, it is never parented under the > application's main window, but appears in the tool bar (yes I use > Windows) as a separate window. This is not the same behavior than when > creating windows with the built in commands of the application. I cam > across this post (http://nathanhorne.com/?p=298) where a workaround of > the same problem is explained, but for the PyQt package, so I wondered, > if there is a similar trick that could be used with PySide. > > Just for your information: > The method "|apiUI.MQtUtil.mainWindow()|" returns a <Swig Object of type > 'QWidget *'> and we can cast its memory address with long().
We don't have any equivalent way of doing what sip.wrapinstance does. Although
if you are compiling your own PySide you can write an small code injection on
PySide typesystem to add this function.
I didn't test the code bellow but if you throw it inside PySide QtCore
typesystem it may work =]
<add-function signature="wrapInstance(unsigned long, PyType)">
<inject-code>
if (Shiboken::ObjectType::checkType(%2)) {
%PYARG_0 = Shiboken::Object::newObject(
(SbkObjectType*)%1,
(void*)%2, false);
}
</inject-code>
</add-function>
You may ask, why you didn't add this code to PySide already? simple... because
QtCore isn't the right place for it, but a separated module probably called
"shiboken" and we didn't it yet.
Regards
--
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
