<?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[Cannot set QDialog modal]]></title><description><![CDATA[<p dir="auto">Running PySide6 under Ubuntu Linux<br />
In my class Dialog(QtDialog) <strong>init</strong> I call self.setWindowModality(Qt.WindowModal)<br />
and then print(self.windowModality())) which reports: 'WindowModality.WindowModal', but the dialog does NOT stay on top.</p>
<p dir="auto">I can force modal by  checking 'Always on Top' in the panel icon.</p>
<p dir="auto">What did I miss?</p>
]]></description><link>https://forum.qt.io/topic/164963/cannot-set-qdialog-modal</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 11:55:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164963.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Aug 2026 11:46:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cannot set QDialog modal on Tue, 04 Aug 2026 11:17:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oldbrad">@<bdi>oldbrad</bdi></a><br />
So far as I recall, you should have no trouble having a modal dialog on top of all/any other windows in an application, certainly under Xorg if maybe not under Wayland, and without setting <strong>Always on Top</strong>.  But I think your choice of <code>self.setWindowModality(Qt.WindowModal)</code> is wrong, that is looking for one parent to be modal to and you are not passing any.  As per <a href="https://doc.qt.io/qt-6/qt.html#WindowModality-enum" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qt.html#WindowModality-enum</a> you should use <code>Qt::ApplicationModal</code> if you are not going to set a parent window for it to be modal against.</p>
]]></description><link>https://forum.qt.io/post/839518</link><guid isPermaLink="true">https://forum.qt.io/post/839518</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 04 Aug 2026 11:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to Cannot set QDialog modal on Tue, 04 Aug 2026 09:11:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/friedemannkleint">@<bdi>friedemannkleint</bdi></a> said in <a href="/post/839511">Cannot set QDialog modal</a>:</p>
<blockquote>
<p dir="auto">What Desktop/Windowing system is this?</p>
</blockquote>
<p dir="auto">$ echo $XDG_SESSION_TYPE<br />
x11</p>
<p dir="auto">But  I think your implication is that a Dialog without a parent and cannot go modal over other application windows?</p>
]]></description><link>https://forum.qt.io/post/839516</link><guid isPermaLink="true">https://forum.qt.io/post/839516</guid><dc:creator><![CDATA[oldbrad]]></dc:creator><pubDate>Tue, 04 Aug 2026 09:11:20 GMT</pubDate></item><item><title><![CDATA[Reply to Cannot set QDialog modal on Mon, 03 Aug 2026 13:48:19 GMT]]></title><description><![CDATA[<p dir="auto">Most likely, a parent widget.. What Desktop/Windowing system is this?</p>
]]></description><link>https://forum.qt.io/post/839511</link><guid isPermaLink="true">https://forum.qt.io/post/839511</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Mon, 03 Aug 2026 13:48:19 GMT</pubDate></item></channel></rss>