I solved it myself and just to answer my own question if someone will find it helpful.
Keep it in the center:
void MyMainWindow::moveEvent(QMoveEvent* event)
{
const QPoint global = this->mapToGlobal(rect().center());
waitDialog->move(global.x() - waitDialog->width() / 2, global.y() - waitDialog->height() / 2);
}
... where waitDialog
is an instance of my "Wait..." indicator. This needs to override the moveEvent
method of the parent (here MyMainWindow
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…