Qt get screen size and set window location

Linux Qt
<pre><code>WidgetMainWindow w; QRect rec : QApplication::desktop()-&gt;screenGeometry(); int height : rec.height(); int width : rec.width(); w.setGeometry(width - 450, 10, 450, 700); w.show(); </code></pre>

© 2026 Code0x378