1.获取父窗口相对于屏幕的坐标,即绝对坐标
2.计算子窗口的坐标
3.移动窗口
QPoint globalPos = parentWidget->mapToGlobal(QPoint(0,0));//父窗口绝对坐标
int x = globalPos.x() + (parentWidget->width() - this->width()) / 2;//x坐标
int y = globalPos.y() + (parentWidget->height() - this->height()) / 2;//y坐标
this->move(x, y);//窗口移动