Qt 讓彈出的視窗居中顯示

enjoyfate發表於2020-03-02

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

相關文章