QMessageBox set position

In the code I am using

QMessageBox::warning(this,"test","test");

Ideally, I need it to be displayed in the center of the main control, but this box is displayed in the upper left corner, so how to make it display in the center?

My approach is, don't specify the parent object

QMessageBox::information(nullptr,"test","test");

just like this

Guess you like

Origin blog.csdn.net/qq_42815643/article/details/131208546
Recommended