How to Center a Window on the Screen: Difference between revisions
Jump to navigation
Jump to search
AutoSpider (talk | contribs) (Add "cleanup" tag) |
m (Wieland moved page Center a Window on the Screen to How to Center a Window on the Screen: underscores) |
Revision as of 12:14, 28 June 2015
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
English | Deutsch | Български | 한국어
How to center a window on the screen
#include <QStyle>
#include <QDesktopWidget>
window->setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
window->size(),
qApp->desktop()->availableGeometry()
));