<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QMainWindow and its children vs visibility at focus change&#x2F;minimizing]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have a <code>QMainWindow</code> instance with bunch of <code>QDialog</code>s and <code>QWidget</code>s set as its childern. User may open them by clickin some actions on menubar. What is happening, that in fact I don't want to be happenin:</p>
<ul>
<li>when I minimize main window its children are minimized as well (I guess because they are its children)</li>
<li>when I have some dialog/widget opened (visible) it stays ON TOP of the main window even if I click in the main windows area (focus thingy i guess)</li>
</ul>
<p dir="auto">My question is:</p>
<ul>
<li>is there a non-complicated solution to fix this behaviour? Idk.. like settings a flag? something like that, I cannot find anything in docs (at least so far)</li>
</ul>
<p dir="auto">What I came across during searching:</p>
<ul>
<li>'orphaning' children :D (setting their parent to Q_NULLPTR)  inside <code>stateChanged</code> event and turning it back again depending on the event type.<br />
I did not test/used it yet since out of curiosity I wanted to ask you guys about it? Do you think above solution is sensible enough to be used or are there any other better ones?</li>
</ul>
<p dir="auto">Best Regards,<br />
M.</p>
]]></description><link>https://forum.qt.io/topic/69488/qmainwindow-and-its-children-vs-visibility-at-focus-change-minimizing</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 05:50:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/69488.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jul 2016 20:25:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QMainWindow and its children vs visibility at focus change&#x2F;minimizing on Wed, 20 Jul 2016 20:48:23 GMT]]></title><description><![CDATA[<p dir="auto">Can you point me to this thread (just in case - I may find something usefull there)?</p>
]]></description><link>https://forum.qt.io/post/338618</link><guid isPermaLink="true">https://forum.qt.io/post/338618</guid><dc:creator><![CDATA[michelson]]></dc:creator><pubDate>Wed, 20 Jul 2016 20:48:23 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow and its children vs visibility at focus change&#x2F;minimizing on Wed, 20 Jul 2016 20:45:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michelson">@<bdi>michelson</bdi></a><br />
Well often :)<br />
There was a thread not so long ago talking<br />
about how to delete the dialogs later.<br />
If you make them members, its pretty basic.</p>
]]></description><link>https://forum.qt.io/post/338616</link><guid isPermaLink="true">https://forum.qt.io/post/338616</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 20 Jul 2016 20:45:30 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow and its children vs visibility at focus change&#x2F;minimizing on Wed, 20 Jul 2016 20:42:29 GMT]]></title><description><![CDATA[<p dir="auto">Simplest solutions are the best  - thank you!<br />
I kinda feel really dumb now :D<br />
Anyway - solved.</p>
]]></description><link>https://forum.qt.io/post/338614</link><guid isPermaLink="true">https://forum.qt.io/post/338614</guid><dc:creator><![CDATA[michelson]]></dc:creator><pubDate>Wed, 20 Jul 2016 20:42:29 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow and its children vs visibility at focus change&#x2F;minimizing on Wed, 20 Jul 2016 20:38:57 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
Have you tried simply not to give the dialogs a parent?</p>
<p dir="auto">MyDialog  * dia= new MyDialog ();</p>
<p dir="auto">You will need to delete them your self when app is closing.</p>
]]></description><link>https://forum.qt.io/post/338612</link><guid isPermaLink="true">https://forum.qt.io/post/338612</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 20 Jul 2016 20:38:57 GMT</pubDate></item></channel></rss>