<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: catching close event of MayaQWidgetDockableMixin in Maya2017 in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/8382179#M12475</link>
    <description>&lt;P&gt;Hi there, sorry to bump into this old thread.&lt;/P&gt;&lt;P&gt;I was using Maya 2018 and it seems that I am getting the issue - unable to 'capture' the close events (have used either closeEvent or the dockCloseEventTriggered).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accordingly to your last post, do correct me if I am wrong, for the workspaceControls - should I or should I not delete them if found?&lt;/P&gt;&lt;P&gt;FYI - I did try it out in Maya 2017, while sing dockCloseEventTriggered seems to have work, and I did factor in my function to delete any existing workspaceControls if found, I am still unable to figure out why it is not working for Maya 2018.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 06:21:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-06T06:21:26Z</dc:date>
    <item>
      <title>catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/6717106#M12470</link>
      <description>&lt;P&gt;I'm creating a dockable window from MayaQWidgetDockableMixin. The window creates and manages some callbacks.&lt;/P&gt;&lt;P&gt;In Maya 2016 the function "dockCloseEventTriggered" was called when the window was closed and I could clean up my callbacks.&lt;/P&gt;&lt;P&gt;But in 2017 this function is not called anymore. I tried using the new "closeCallback" that get's passed to the workspaceControl but it seems the window is already destroyed at this moment and&amp;nbsp; I can't find a way to clean the callbacks. The callbacks remain and keep messing up my scene.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a new way to catch the close event of a MayaQWidgetDockableMixin?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 21:38:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/6717106#M12470</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-29T21:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7496394#M12471</link>
      <description>&lt;P&gt;I'm also encountering this issue - did you have any conclusion?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 10:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7496394#M12471</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-27T10:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7497159#M12472</link>
      <description>&lt;P&gt;I've spent some time looking into this now, eventually comparing the mayaMixin.py files between 2016 and 2017&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It appears in 2016 they created a&amp;nbsp;MayaQDockWidget *within* the MayaQDockableMixin and propogated the signal of closeEvent on the QDockWidget to the MayaQDockableMixin.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In 2017 they have removed the MayaQDockWidget and left the signal inside MayaQDockableMixin unhooked!! ( Jeez! like really?! )&amp;nbsp;&lt;BR /&gt;Instead, in 2017 they have replaced this functionality with a new option for .show( closeCallback=... ) which initially looked really cool as they were handling the workspace creation + cleanup, the big gotcha however is you *cannot* pass a bound/unbound method to the closeCallback, you have to pass a string that can be evaluated such as "import MyTest\rMyTest.runSomeMethod()"&lt;BR /&gt;&lt;BR /&gt;This seems... like a step back in my opinion, i have yet to reach a answer i find satisfactory as now to trigger an event on the close of my Qt interface, i can't just call its internal cleanup method, i need to import and assign the interface again to call its shutdown....&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm going to head home and think on this over the weekend, i'll return if i find a happy solution&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 15:25:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7497159#M12472</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-27T15:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7504401#M12473</link>
      <description>&lt;P&gt;Back at work digging into this more,&lt;BR /&gt;&lt;BR /&gt;According to the Maya 2017 SP4 Release notes&lt;BR /&gt;&lt;BR /&gt;"&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MAYA-76709 :&lt;/TD&gt;&lt;TD&gt;mayaMixin functions floatingChanged and dockCloseEventTriggered are not called with Workspace controls&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;"&lt;BR /&gt;&lt;BR /&gt;This has been fixed, but diffing the code - nothing has changed.... also now im getting error spam re:&lt;BR /&gt;&lt;BR /&gt;"&lt;BR /&gt;# AttributeError: 'module' object has no attribute 'workspaceControlClosed'&lt;BR /&gt;# AttributeError: 'module' object has no attribute 'workspaceControlReparented'&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;Whenever working with workspaces....&lt;BR /&gt;&lt;BR /&gt;I'm getting Maya 2018 to see if its fixed in there, if not ill roll back to 2017 vanilla and apply my own patch ( will post code if it works )&lt;BR /&gt;&lt;BR /&gt;@Anonymous support peeps - any comment on why the fix was in the patch notes but there is no change in code?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 11:28:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7504401#M12473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-31T11:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7514627#M12474</link>
      <description>&lt;P&gt;Ok&lt;BR /&gt;&lt;BR /&gt;Finished rebuilding my dock factory in 2018 as the signals work there again as expected,&lt;BR /&gt;&lt;BR /&gt;You may come across a internal C++ runtime error though when using workspace retain=False - it appears that there is a "workspaceControlDeleted" method *and* a __del__ method of the mixin that both attempt to remove the mixin class - the first will run successfully, the second will cause the C++ error&lt;BR /&gt;&lt;BR /&gt;I resolved this by having a dockable factory i call with UI files - in my factory i override the __del__ with pass to avoid the duplicate call - all seems stable once more - huzzah!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:14:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/7514627#M12474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-03T11:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/8382179#M12475</link>
      <description>&lt;P&gt;Hi there, sorry to bump into this old thread.&lt;/P&gt;&lt;P&gt;I was using Maya 2018 and it seems that I am getting the issue - unable to 'capture' the close events (have used either closeEvent or the dockCloseEventTriggered).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accordingly to your last post, do correct me if I am wrong, for the workspaceControls - should I or should I not delete them if found?&lt;/P&gt;&lt;P&gt;FYI - I did try it out in Maya 2017, while sing dockCloseEventTriggered seems to have work, and I did factor in my function to delete any existing workspaceControls if found, I am still unable to figure out why it is not working for Maya 2018.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 06:21:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/8382179#M12475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-06T06:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: catching close event of MayaQWidgetDockableMixin in Maya2017</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/8382619#M12476</link>
      <description>&lt;P&gt;Hi no worries, Will help if i can!&lt;BR /&gt;&lt;BR /&gt;So its been a while but the jist of what i have is a Dockable class that derives from the MayaQWidgetDockableMixin and my UiClass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__init__&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Predict what the workspace name by the name of the ui file&lt;/LI&gt;&lt;LI&gt;Attempt to remove any existing workspaces matching that predicted name&lt;/LI&gt;&lt;LI&gt;Call Super&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;def dockCloseEventTriggered()&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Call application.postEvent(QtCore.QEvent(QtCore.QEvent.Close))&lt;/LI&gt;&lt;LI&gt;Call application.sendPostedEvents()&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;def close():&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Call a cleanup function ( removes workspace + sets widget parent to be None / deletes self )&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Call super of close&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thats about it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Hth!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 10:16:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/catching-close-event-of-mayaqwidgetdockablemixin-in-maya2017/m-p/8382619#M12476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-06T10:16:22Z</dc:date>
    </item>
  </channel>
</rss>

