严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C4996 'QDesktopWidget::availableGeometry': Use QGuiApplication::screens(
解决方法:
QRect rect = w.frameGeometry();
QDesktopWidget desktop;
// QPoint centerPoint = desktop.availableGeometry().center();
// QPoint centerPoint = QGuiApplication::screens;
QPoint centerPoint= QGuiApplication::primaryScreen()->availableGeometry().center();
rect.moveCenter(centerPoint);
w.move(rect.topLeft());
即可居中显示咯