I've tried these in my mainform's constructor:
QRect desktopRect = QApplication::desktop()->availableGeometry(this);
move(desktopRect.center() - frameGeometry().center());
QRect desktopRect = QApplication::desktop()->availableGeometry(this);
move(desktopRect.center() - rect().center());
but both put the bottom right corner of the form at about the center of the screen, instead of centering the form. Any ideas?
this->resize(width_I_want, height_I_want)
before the code to center it. Thanks! – Jellied