MayaQWidgetDockableMixin allowedArea?



So I have my class inheriting from MayaQWidgetDockableMixin, however when I try to set the allowedArea I get an error.
I know I’m missing something here.

from PySide import QtGui
from import MayaQWidgetDockableMixin

class App(MayaQWidgetDockableMixin,QtGui.QDialog):
ui = App(), floating=False, area='right', allowedArea='right', width=200, height=300, x=300, y=600)


// Error: 'MayaQDockWidget' object has no attribute 'setAllowedArea'
#     ui.setDockableParameters(dockable=True, floating=False, area='right', allowedArea='right', width=200, height=300, x=300, y=600)
#   File "C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\maya\app\general\", line 299, in setDockableParameters
#     dockWidget.setAllowedArea(areaValue)
# AttributeError: 'MayaQDockWidget' object has no attribute 'setAllowedArea' //

If I leave out the allowedArea it works fine.

MayaQWidgetDockableMixin closeEvent is not working

Hmmm… I see a function on QDockWidget called “setAllowedAreas”. I suspect a mistake in site-packages\maya\app\general\ Either they meant to type “setAllowedArea” instead of “setAllowedArea”, or they meant to create a function called “setAllowedArea” in the MayaQDockWidget class.

Since you are subclassing from MayaQWidgetDockableMixin, maybe you could add your own “setAllowedArea” function?

Edit: On second thought, I’m not 100% sure that would work. Trying to read through the code with all the multiple inheritance and stuff. Anyways, let us know what you try, what works and what doesn’t.


That was it. Line 299 in has a typo.
It should be :
instead of:

Yea, I’ll have to SubClass the MayaQWidgetDockableMixin and override the method with the fixed typo.