On Wed, Jan 16, 2019 at 9:38 AM likage <dissidia....@gmail.com> wrote:

> Hi, thanks for getting back to me. It seems that the newly added items are
> added to the end (bottom) of the QMenu instead of in-between the 'Add new
> item' and the 'Default Item'..
>

The documentation for insertAction(before, action) says it will insert the
new action *before* the given one, so I would have expected it to put them
before the separator. But it also says it will end up appending it if
"before" is not a valid action for the menu.


>
> Also as mentioned in my first post, is it possible to create different
> QMenus for different tabs?
> Eg. I create 'item01' for TabA and I created 2 new items - 'item01a' and
> 'item01b' for TabB...  And based on which tabs that I perform a right-mouse
> click on, it will show the update menu
>

This should be possible with the available functionality of a QTabBar. I
imagine the following aspects would come into play:

   - A dictionary of tab to QMenu and creating a new one if needed
   - Maybe implementing tabInserted and tabRemoved methods if you want to
   directly track the tabs and create/remove menus at this stage
   - Checking tabAt(point) in your content menu handler to look up the
   correct QMenu to exec



>
> --
> 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/8b47ffc7-6ff5-4171-bf3d-c21e944219eb%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/8b47ffc7-6ff5-4171-bf3d-c21e944219eb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA1QVgHPdjLzzVoYfCAVdEDEGV0XJ5nraLpN1NJbrL_1Yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to