I wonder if wrapping the window to a QWidget vs QObject would make a difference
in the problem Kurian was having with my example.
Out of curiosity, Jo does my example work for you properly? I dont have a maya
2011 set up handy to test, and I wonder if I was just using some slight syntax
variations that conflict with 2011 qt. Thought maybe he was using 2012.
On Nov 20, 2011, at 10:51 PM, jo benayoun wrote:
> Hi Kurian,
>
> this version works here, I didn't try the justin's one, but the concept stays
> the same.
> its a dummy function, if you need to do more, make a class.
>
>
> import sip
> from PyQt4.QtGui import QMainWindow
> from PyQt4.QtGui import QWidget
>
> import maya.cmds as cmds
> from maya.OpenMayaUI import MQtUtil
>
> def maya_window():
> return sip.wrapinstance(long(MQtUtil.mainWindow()), QWidget)
>
> def mk_view(name):
> mw = QMainWindow(maya_window())
> mw.setObjectName(name)
> panel = cmds.modelPanel()
> panel = sip.wrapinstance(long(MQtUtil.findControl(panel)), QWidget)
> mw.setCentralWidget(panel)
> mw.setWindowTitle(name)
> mw.resize(1024, 800)
> mw.update()
> return mw
>
> def main():
> mk_view("MyNewWindow").show()
> return 0
>
> main()
>
> hope that help !
> jo
>
>
>
>
> 2011/11/21 Kurian O.S <[email protected]>
>
> # Error: 'parent' is not a Qt property or a signal
> # Traceback (most recent call last):
> # File "<maya console>", line 9, in <module>
> # File "<maya console>", line 14, in __init__
>
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe