PDA

View Full Version : Centering a window



dwarnold45
30th March 2010, 07:29
All,

I think PyQt had a .Centre() method that would center a window, but I can't find its counterpart in C++. Anyone?

David.

Lykurg
30th March 2010, 07:43
You have to calculate by your own:
QRect rect = QApplication::desktop()->availableGeometry(widget);
widget->move(rect.center() - widget->rect().center());