vs QT Use QGuiApplication::screens报错

严重性    代码    说明    项目    文件    行    禁止显示状态 错误    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());

即可居中显示咯   

相关推荐

  1. IDEA

    2024-07-12 06:42:02       57 阅读
  2. sqoop运行

    2024-07-12 06:42:02       57 阅读
  3. yarn install

    2024-07-12 06:42:02       50 阅读
  4. 安装Paddlehub

    2024-07-12 06:42:02       57 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 06:42:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 06:42:02       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 06:42:02       58 阅读
  4. Python语言-面向对象

    2024-07-12 06:42:02       69 阅读

热门阅读

  1. 【qml学习笔记】QML与C++的交互

    2024-07-12 06:42:02       29 阅读
  2. stm32使用串口打印

    2024-07-12 06:42:02       22 阅读
  3. Windows驱动开发

    2024-07-12 06:42:02       26 阅读
  4. [linux] git push时需要输入user 和keyword

    2024-07-12 06:42:02       22 阅读
  5. 【AIGC】GPT-4深度解析:自然语言处理的新纪元

    2024-07-12 06:42:02       23 阅读
  6. PyTorch中的CPU和GPU代码实现详解

    2024-07-12 06:42:02       25 阅读
  7. CSS实现从上往下过渡效果

    2024-07-12 06:42:02       28 阅读
  8. 力扣第228题“汇总区间”

    2024-07-12 06:42:02       23 阅读