Is there a way to embed a Maya UI component to a PySide window? I would like to add a Maya UI cmds.attControlGrp() to a PySide window it would save me lots of code and time if I could get that to work. Any ideas on how to do that?
[QUOTE=Styler;29909]Use MQtUtil module. Look here for details
import maya.OpenMayaUI as omui
# foo window
pmc.window()
pmc.columnLayout()
atcrl = pmc.attrControlGrp(attribute='defaultResolution.width')
pmc.showWindow()
# get QWidget
qwidget = omui.MQtUtil.findControl(atcrl)
[/QUOTE]
Thanks for the answer. The qwidget type is SwigPyObject, is there anyway to get it to return it as a QWidget so that it can be added to a PySide layout?
Sori, I might be in way over my head for doing this, maybe its not as easy as I thought it would be
[QUOTE=Tigerwilly;29912]Thanks for the answer. The qwidget type is SwigPyObject, is there anyway to get it to return it as a QWidget so that it can be added to a PySide layout?
Sori, I might be in way over my head for doing this, maybe its not as easy as I thought it would be :)[/QUOTE]
def mayaToQtObject(inMayaUI):
ptr = omui.MQtUtil.findControl(inMayaUI)
if ptr is None:
ptr = omui.MQtUtil.findLayout(inMayaUI)
if ptr is None:
ptr = omui.MQtUtil.findMenuItem(inMayaUI)
if ptr is not None:
return wrapInstance(long(ptr), QtGui.QWidget)