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?