You can generate a Qt class instance, from a cmds gui widget using
wrapInstance from shiboken.
I have used this in the past:

from PySide2.QtWidgets import QMenu
from maya.OpenMayaUI import MQtUtil
from shiboken2 import wrapInstance
from maya import cmds

cmds_menu: str = cmds.menu(label="cmds_menu", parent="MayaWindow").split("|"
)[-1]
control: "SwigPyObject" = MQtUtil.findControl(str(cmds_menu))
qt_menu: QMenu = wrapInstance(int(control), QMenu)



On Wed, 15 Nov 2023 at 08:15, Marcus Ottosson <konstrukt...@gmail.com>
wrote:

> In that case, I can think of 2 options.
>
>    1. See if there’s another command in cmds you could use to manipulate
>    already-created tabs, I’m not familiar with this part myself so can’t say
>    for sure
>    2. Alternatively, whatever cmds does it is Qt that is ultimately
>    drawing the tabs, which means you can access them via PySide to perform
>    further manipulation
>
> I suspect there is a method of converting a widget created via cmds to
> its corresponding Qt widget, from there you can navigate the widget via
> widget.parent() and widget.children() until you find the QTabWidget or
> whichever widget is doing the drawing of tabs. If there isn’t such a
> method, you can navigate from top-down via
> PySide.QWidgets.QApplication.instance() or by finding the Maya main
> window.
>
> On Tue, 14 Nov 2023 at 22:34, Ravi Jagannadhan <enr...@gmail.com> wrote:
>
>> Alas, they're made via cmds.
>>
>> On Tue, Nov 14, 2023 at 2:07 PM Marcus Ottosson <konstrukt...@gmail.com>
>> wrote:
>>
>>> It would depend on how the tabs are made, are they made via PySide or
>>> cmds?
>>>
>>> On Tue, 14 Nov 2023 at 16:27, Ravi Jagannadhan <enr...@gmail.com> wrote:
>>>
>>>> Hi all, is it possible to hide individual tabs in a tab layout?
>>>>
>>>> Ravi
>>>> —
>>>> “There are no dumb questions” - Carl Sagan
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to python_inside_maya+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/python_inside_maya/BL3PR10MB61639DFE04B08ABB150636B5F6B2A%40BL3PR10MB6163.namprd10.prod.outlook.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/BL3PR10MB61639DFE04B08ABB150636B5F6B2A%40BL3PR10MB6163.namprd10.prod.outlook.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to python_inside_maya+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqkenkr4Zmp%3D4wwQT44f17o7cmw3x8yAkjQD22uJaJ%3DQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqkenkr4Zmp%3D4wwQT44f17o7cmw3x8yAkjQD22uJaJ%3DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Where we have strong emotions, we're liable to fool ourselves - Carl Sagan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to python_inside_maya+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CADHeb2YMEGtjZ%2B7eyPNxwkMBjpLdAPkNMv-rdJJg8Eiu5hdn6w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CADHeb2YMEGtjZ%2B7eyPNxwkMBjpLdAPkNMv-rdJJg8Eiu5hdn6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCMOmhg7O132tSguZKqkN2cS9%3DG8weu1YKfe903RkRpUA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCMOmhg7O132tSguZKqkN2cS9%3DG8weu1YKfe903RkRpUA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
*Juan Moraga*
*Supervising Pipeline & Technical Direction @ MondoTV*

Portfolio: https://juanmoraga.dev
LInkedin: https://www.linkedin.com/in/juanmoragamartin/
<http://juanmoragaart.tumblr.com/>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CA%2BKy2f0UHidUGDSOmOxy0bQJSGMr45nGThgZ1SrfFJ1p2mJBZg%40mail.gmail.com.

Reply via email to