Qt 让弹出的窗口居中显示

QApplication a(argc, argv);
    MainWindow w;
    w.show();
    w.move ((QApplication::desktop()->width() - w.width())/2,(QApplication::desktop()->height() - w.height())/2);
    return a.exec();

 

https://blog.csdn.net/hanxing0/article/details/9076999

你可能感兴趣的:(Qt)