Center a Window on the Screen/bg

From Qt Wiki
Jump to: navigation, search
БългарскиEnglish

Как да позиционираме прозорец в центъра на екрана?

  1. include <QStyle>
  2. include <QDesktopWidget>

window->setGeometry(

QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
window->size(),
qApp->desktop()->availableGeometry()
));