MayaQWidgetDockableMixin stacking docs and tab orientation on init or show

MayaQWidgetDockableMixin stacking docs and tab orientation on init or show

Anonymous
Not applicable
2,631 Views
5 Replies
Message 1 of 6

MayaQWidgetDockableMixin stacking docs and tab orientation on init or show

Anonymous
Not applicable

I have trio of Pyside dialogs that inherit from MayaQWidgetDockableMixin

I've already found the if I parent the 2 sub windows to the main window using:

FooWin(parent=shiboken2.wrapInstance(long(OpenMayaUI.findControl(MainWinObjectName)), QtWidget.QWidget))) 

They'll dock into the main window when using :

show(dockable=True, area='right', floating=False)


However they'll be docked next to eachother.
What I want is for the second window to be tabbed together with the third window to the right of the Main Window. (much like the Attribute Editor and ChannelBox do by default when opened)

Additionally I want the tab direction to be to the right instead of the top. (Like the channelbox default orientation)

If the text only description is insufficient I can take some time to make a minimal viable script to clear out the problems.

0 Likes
Accepted solutions (2)
2,632 Views
5 Replies
Replies (5)
Message 2 of 6

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

Sorry for the delay, I am traveling this week.  I'll try to look at it next week when I am back.

 

BTW: I think if it was possible, there should be some flags or commands provided in Mel to make it work that way.  

 

Yours,

Li

0 Likes
Message 3 of 6

Anonymous
Not applicable

based on your suggestion I managed to come up with a solution for the stacking propblem.
I can, however, still not initialize/modify the tabs to orient themself to the right side of the window.

to fix the stacking problem I wrote something like this

 

 

self.stackedTab.show(dockable=True, area='right', floating=False)
cmds.workspaceControl(nameOfStackedTabUi+'WorkspaceControl', e=True, tabToControl=[nameOfCustomUiToStackTo+'WorkspaceControl', -1], widthProperty='prefered')

I know the orientation is a bit of a vanity thing, but I would find it strange if I couldn't acces it somehow. Cmds or Pyside wise.


Another thing I've noticed while experimenting with workspaceControl is that my UI on reopens has trouble updating it's content I have a list view and when drag selecting multiple elements it wont update the UI (it still does the functions related to the selection action). I have Global UI manager that keeps an instance of every UI in my scripts and shows (pyside call), update(args*, kwargs*) (custom update call I enforce on all UIs) them on subsequent open calls.

If the UI has been tabbed at all (even if it was untabbed on close) (this seems to be the trigger for this one specifically) then it even looks like it thinks it is still a tabbed ui. The dock tab shows on mouseover around the tab area where other UI elements are and everything else shifts down on mouse over sort of in sync with what the tab would've been.
Is it not intended to reshow a closed Mixin UI? I thought maya internally never truly closed any UI. Could it be an order of operations thing? (it is Update -> show now with the update often deleting and creating some subwidgets and hiding the extra tabs that initiated this topic)

I vaguely recal reading a topic somewhere that there were some issues with updates on the mixin classes related to a specific version of maya so just in case I am on Maya 2018 update 4.

 

0 Likes
Message 4 of 6

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

if you want to dock with Channel Box / Layer Editor, you could do it like below.

string $channelsLayersDockControl = getUIComponentDockControl(“Channel Box / Layer Editor”, false);
workspaceControl –e –tabToControl $channelsLayersDockControl -1 yourWorkspaceControl;

There is a flag -tp in workspaceControl command for positioning the tab, I think it should be what you are looking for.

 

For not updating, I think it could a known issue. If you have make Maya main window as parent of your window, it may have refreshing issue. Could you try to create it with no parent?

 

Yours,

Li

0 Likes
Message 5 of 6

Anonymous
Not applicable

The window works correctly now.

Dropping the maya main window parent fixed the bizare ghost tab/weird updating issue (is it on the bugs list I understand?)
And the tabPosition flag fixed the tab orientation to what I wanted.

0 Likes
Message 6 of 6

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Yes, it's on the bug list.

 

I've sent defect ID to you through salesforce, please check it out.

 

Yours,

Li

0 Likes