<?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 top left position excluding frames and menu bar?]]></title><description><![CDATA[<p dir="auto">Hi people.</p>
<p dir="auto">I have a central widget with an opengl viewport. A graphics View.<br />
I have the window and the QMenuBar on it.</p>
<p dir="auto">I need to position floating buttons over the viewport.</p>
<p dir="auto">I want to position them relative to the viewport, top left position, 0,0 . But surprissingly 0,0 is over the MenuBar, as if the menu bar was part of the viewport.</p>
<p dir="auto">I tried:</p>
<p dir="auto">@<br />
button_-&gt;move( mainWindow_-&gt;centralWidget()-&gt;geometry().x(), mainWindow_-&gt;centralWidget()-&gt;geometry().y() + mainWindow_-&gt;menuBar()-&gt;height() );<br />
@</p>
<p dir="auto">But when i grab the window to demaximize it, the button doesn´t stay in the same position. Sometimes stays a little upper, others, on the left...</p>
<p dir="auto">I need the 0,0 position ! but it doesn´t work with mainWindow_ , neither with centralWidget()</p>
]]></description><link>https://forum.qt.io/topic/21199/qmainwindow-top-left-position-excluding-frames-and-menu-bar</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 14:51:39 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21199.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Nov 2012 15:25:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QMainWindow top left position excluding frames and menu bar? on Mon, 17 Dec 2012 14:24:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">did you try "mapToGlobal":<a href="http://qt-project.org/doc/qt-4.8/qwidget.html#mapToGlobal" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qwidget.html#mapToGlobal</a></p>
]]></description><link>https://forum.qt.io/post/159855</link><guid isPermaLink="true">https://forum.qt.io/post/159855</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 17 Dec 2012 14:24:24 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow top left position excluding frames and menu bar? on Mon, 17 Dec 2012 13:08:32 GMT]]></title><description><![CDATA[<p dir="auto">I finally did it by hand, using by hand values, but this sollution is so bad... i don´t find another way!.</p>
]]></description><link>https://forum.qt.io/post/159847</link><guid isPermaLink="true">https://forum.qt.io/post/159847</guid><dc:creator><![CDATA[darkgaze]]></dc:creator><pubDate>Mon, 17 Dec 2012 13:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow top left position excluding frames and menu bar? on Thu, 08 Nov 2012 08:46:44 GMT]]></title><description><![CDATA[<p dir="auto">That doesn´t work. I knew you would probably tell me that :D</p>
<p dir="auto">Doesn´t work at all. It only talks about the TITLE BAR, no the menu bar.</p>
<p dir="auto">geometry 0,0  means top left of the MENU BAR.</p>
]]></description><link>https://forum.qt.io/post/156360</link><guid isPermaLink="true">https://forum.qt.io/post/156360</guid><dc:creator><![CDATA[darkgaze]]></dc:creator><pubDate>Thu, 08 Nov 2012 08:46:44 GMT</pubDate></item><item><title><![CDATA[Reply to QMainWindow top left position excluding frames and menu bar? on Wed, 07 Nov 2012 17:35:08 GMT]]></title><description><![CDATA[<p dir="auto">You should take a look at "that":<a href="http://qt-project.org/doc/qt-4.8/application-windows.html#window-geometry" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/application-windows.html#window-geometry</a>. Hope this helps!</p>
]]></description><link>https://forum.qt.io/post/156321</link><guid isPermaLink="true">https://forum.qt.io/post/156321</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 07 Nov 2012 17:35:08 GMT</pubDate></item></channel></rss>