I know that QDialog's are supposed to default to being positioned centered on the parent window but I'm apparently missing some subtlety. I have an object, derived from QWidget, and am trying to create a child dialog centered on that using the following test code
QDialog *dialog = new QDialog(this);
QPoint dialogPos = dialog->mapToGlobal(dialog->pos());
QPoint thisPos = mapToGlobal(this->pos());
dialog->exec();
When I do this, the dialog is showing up in the top left corner of my window. dialogPos is (0,0) and thisPos is (808, 371).
What am I missing? Why is the dialog not showing up centered as I would expect?