Agreed, and these days everything is comprised of these “workspaceControls”
rather than dockwidgets - I think that mixin class is out of date already.

Personally I use a pretty ugly hack these days where:
- I create a workspaceControl
- grab a handle to it using the MQtUtil findControl method
- and shove my own qt widget in to the child layout of that control.

I’m not sure if this will help with you signal problem, but I suspect it
will - its a bit of a “best of both worlds” solution. You can still
maintain your pointer to your own widget (without any weird mixin shizzle)
and also use the workspaceControl maya.cmds to manage the window state.
On Fri, 23 Nov 2018 at 1:18 pm, Joe Weidenbach <scdr...@gmail.com> wrote:

> Maya2018 went to Qt5, so you might need to read the sources and see what's
> going on with the docking code.  My supposition is that it's using a
> QDockableWidget under the hood, but my experience with Maya 2018 and
> docking custom UI's is very mixed.
>
> On Fri, 23 Nov 2018 at 15:01 likage <dissidia....@gmail.com> wrote:
>
>> Hi all,
>>
>> I am using `MayaQWidgetDockableMixin` and for some reasons when using
>> Maya 2018, some of the signals are not working when the tool is closed.
>> While I have managed to find a way to resolve this which is by sending
>> the tool to be docked upon first execution. By doing so, whether I closed
>> it while it was docked or when I tear it off and closed the tool, the
>> closed signals will then be called.
>>
>> This is how I did it by using the `setDockableParameters` argument in the
>> following manner:
>> self._window.setDockableParameters(
>>            dockable=True, x=x_pos, y=y_pos, allowedArea='left', area=
>> 'left'
>>        )
>>
>> My question would be - How can I tear off my tool when it is first docked?
>> I tried doing the following:
>> # Check if window is docked or not
>> if not self._window.isFloating():
>>   """
>>   Details for `raise_()`:
>>   Raises the widget to the top.  Will raise the parent widget if it is a
>> QDockWidget.
>>   Overrides standard QWidget.raise_()
>>   """
>>     self._window.raise_()
>>
>> It does not seems to be tearing off the said tool at all. but instead the
>> tool remains docked.
>>
>>
>> Appreciate in advance if anyone may have any ideas.
>>
>> --
>> 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/c16baaee-c571-491f-91bb-f2312ac31650%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/c16baaee-c571-491f-91bb-f2312ac31650%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/CAM33%3Da4muqVdO%3DfsCTgJhpG5j%2B5UjFZeptjrW%2BPE-Z_pfnTZBw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da4muqVdO%3DfsCTgJhpG5j%2B5UjFZeptjrW%2BPE-Z_pfnTZBw%40mail.gmail.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/CAPzKG6X7LEwvXjdXTdfhc75xO%2Bbyop3PABuNO4cLe51ohNkdcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to