<?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[Main window set geometry doesn&#x27;t always work]]></title><description><![CDATA[<p dir="auto">I have a Qt desktop app (Qt5, MSVC17, x64) that saves the main window geometry on exit, and loads back that geometry on startup.<br />
On startup, after the UI has been initialized (ui-&gt;setupUI(this)) I read the geometry from the saved settings and call setGeometry(geomrect)<br />
I verify with qDebug() output that the saved/read geometry values are correct. The problem<br />
is that sometimes the main window is positioned way to the left of where the geometry says<br />
it should be positioned. It never moves vertically, just horizontally. In my paintEvent method<br />
I can see that the main window geometry has indeed been shifted left, usually by a significant amount. The result is that sometimes the window is not actually visible on<br />
the screen.<br />
What's going on?</p>
]]></description><link>https://forum.qt.io/topic/123917/main-window-set-geometry-doesn-t-always-work</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 22:44:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/123917.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Feb 2021 15:48:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Main window set geometry doesn&#x27;t always work on Fri, 19 Feb 2021 02:22:02 GMT]]></title><description><![CDATA[<p dir="auto">If it was non-windoze I would suggest that main window location is treated by many window managers as a "hint" and not a "rule".  Not sure what the placement rules are in the MS world.</p>
]]></description><link>https://forum.qt.io/post/645337</link><guid isPermaLink="true">https://forum.qt.io/post/645337</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Fri, 19 Feb 2021 02:22:02 GMT</pubDate></item><item><title><![CDATA[Reply to Main window set geometry doesn&#x27;t always work on Wed, 17 Feb 2021 19:35:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How do you save and reload the geometry ?<br />
When do you do it ?</p>
]]></description><link>https://forum.qt.io/post/645077</link><guid isPermaLink="true">https://forum.qt.io/post/645077</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 17 Feb 2021 19:35:58 GMT</pubDate></item></channel></rss>