代码示例:
#include <QDesktopWidget>
QDesktopWidget *desktop = QApplication::desktop();
QWidget w;
w.resize(800,800);
w.move((desktop->width() - w.width()) / 2,\
(desktop->height() - w.height()) / 2);
w.show();
代码示例:
#include <QDesktopWidget>
QDesktopWidget *desktop = QApplication::desktop();
QWidget w;
w.resize(800,800);
w.move((desktop->width() - w.width()) / 2,\
(desktop->height() - w.height()) / 2);
w.show();