Discussion:
[Maya-Python] How to undock tool when using MayaQWidgetDockableMixin
likage
2018-11-23 02:01:15 UTC
Permalink
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+***@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.
For more options, visit https://groups.google.com/d/optout.
Joe Weidenbach
2018-11-23 02:18:07 UTC
Permalink
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.
Post by likage
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
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?
# Check if window is docked or not
"""
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
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+***@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.
For more options, visit https://groups.google.com/d/optout.
Phil Sloggett
2018-11-23 04:08:15 UTC
Permalink
This post might be inappropriate. Click to display it.
likage
2018-11-23 04:13:52 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...