How to Center a Window on the Screen
Jump to navigation
Jump to search
English | Deutsch | Български | 한국어
How to center a window on the screen
<br />#include <QStyle&gt;<br />#include <QDesktopWidget&gt;
window->setGeometry(<br /> QStyle::alignedRect(<br /> Qt::LeftToRight,<br /> Qt::AlignCenter,<br /> window->size(),<br /> qApp->desktop()->availableGeometry()<br /> ));<br />