<?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 Open and close a qwidget dialog in a utility Plugin in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11446823#M3627</link>
    <description>&lt;P&gt;What is the proper way to open and close a qwidget dialog window in a utility plugin?&amp;nbsp; I currently have the dialog open but when I close it it goes away but if I move off the Utilities tab and back again it will pop up again.&amp;nbsp; So somehow it is not closing correctly.&amp;nbsp; I haven't found a good modal window using qwidget in the sdk so I'm kind of winging it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 23:44:43 GMT</pubDate>
    <dc:creator>rodbrew2</dc:creator>
    <dc:date>2022-09-26T23:44:43Z</dc:date>
    <item>
      <title>Open and close a qwidget dialog in a utility Plugin</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11446823#M3627</link>
      <description>&lt;P&gt;What is the proper way to open and close a qwidget dialog window in a utility plugin?&amp;nbsp; I currently have the dialog open but when I close it it goes away but if I move off the Utilities tab and back again it will pop up again.&amp;nbsp; So somehow it is not closing correctly.&amp;nbsp; I haven't found a good modal window using qwidget in the sdk so I'm kind of winging it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 23:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11446823#M3627</guid>
      <dc:creator>rodbrew2</dc:creator>
      <dc:date>2022-09-26T23:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Open and close a qwidget dialog in a utility Plugin</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11448826#M3628</link>
      <description>&lt;P&gt;Looking a little farther into this it's not so much closing the qwidget window as it is destroying the utility itself when the X on the qwidget window is pressed.&amp;nbsp; I'm not sure how to tie those two together.&amp;nbsp; I hope this makes sense.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 23:18:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11448826#M3628</guid>
      <dc:creator>rodbrew2</dc:creator>
      <dc:date>2022-09-27T23:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Open and close a qwidget dialog in a utility Plugin</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11450361#M3629</link>
      <description>&lt;P&gt;Doesn't deleting your qwindow is enough ?&lt;BR /&gt;&lt;BR /&gt;Supposing your window is named "MyWindow"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class MyWindow(QWindow):
    def __init__(self, ...):
        # your stuff here

    def closeEvent(self, *args):
        del self&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 15:19:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11450361#M3629</guid>
      <dc:creator>Bendo_</dc:creator>
      <dc:date>2022-09-28T15:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Open and close a qwidget dialog in a utility Plugin</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11452823#M3630</link>
      <description>&lt;P&gt;Hey Bendo I'm thinking it's not the qwidget window that's the problem it's actually shutting down the Utility plugin itself that seems to be missing.&amp;nbsp; For instance if I add a button for the plugin on the Utility panel and press it the UI comes up and the button remains pressed.&amp;nbsp; If I close the UI the button remains pressed.&amp;nbsp; If I cycle it again the UI comes up as normal.&amp;nbsp; If I don't unpress and navigate away from the utility panel and then back the button is still blue and the UI pops up again.&amp;nbsp; I guess this is kind of expected as it does it with a normal rollout.&amp;nbsp; A good example of the behavior I'm looking for is the Polygon Counter utility but with the qwidget.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:16:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11452823#M3630</guid>
      <dc:creator>rodbrew2</dc:creator>
      <dc:date>2022-09-29T18:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Open and close a qwidget dialog in a utility Plugin</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11453111#M3631</link>
      <description>&lt;P&gt;Ok I think I got something figured out.&amp;nbsp; Not sure if it's the best way but it seems to work.&amp;nbsp; I added a closeEvent to my main UI in which I call the closeUtility function for my instance of the Utility plugin.&amp;nbsp; I also have a flag that keeps track of whether the UI dialog is open of not.&amp;nbsp; Like I said I'm not sure if this is the ideal way but it seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;void Utility::BeginEditParams(Interface* ip, IUtil* u)
{
	this-&amp;gt;iu = u;
	this-&amp;gt;ip = ip;

	if (dialogOpen == FALSE)
	{
		dialog = new UtilityUI_Main;

		dialog-&amp;gt;setWindowModality(Qt::WindowModal);

		dialog-&amp;gt;show();

		dialogOpen = TRUE;
  }
	u-&amp;gt;CloseUtility();
}

void UtilityUI_Main::closeEvent(QCloseEvent* event)
{
	if (myUtility.iu)
		myUtility.iu-&amp;gt;CloseUtility();
	dialogOpen = false;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 20:59:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/open-and-close-a-qwidget-dialog-in-a-utility-plugin/m-p/11453111#M3631</guid>
      <dc:creator>rodbrew2</dc:creator>
      <dc:date>2022-09-29T20:59:19Z</dc:date>
    </item>
  </channel>
</rss>

