1、头文件

#include<QScreen>

 

2、代码

QScreen *screen = QGuiApplication::primaryScreen ();
QRect screenRect = screen->availableVirtualGeometry(); resize(screenRect.width(),screenRect.height());

3、如果想直接初始主窗口最大化

setWindowState(Qt::WindowMaximized);

4、下面这些参数可用设定主窗口初始状态

Constant

Value

Description

Qt::WindowNoState

0x00000000

The window has no state set (in normal state).

Qt::WindowMinimized

0x00000001

The window is minimized (i.e. iconified).

Qt::WindowMaximized

0x00000002

The window is maximized with a frame around it.

Qt::WindowFullScreen

0x00000004

The window fills the entire screen without any frame around it.

Qt::WindowActive

0x00000008

The window is the active window, i.e. it has keyboard focus.

最新文章

  1. 解决Native atomics support not found问题
  2. 如何在Windows7上完全卸载Oracle 11g(转)
  3. ASP.NET MVC 混搭 ASP.NET WebForms 所导致的 Html.ActionLink/BeginForm 问题
  4. 1Z0-053 争议题目解析510
  5. visual studio 2013 快捷键大全
  6. druid 源码分析与学习(含详细监控设计思路的彩蛋)(转)
  7. 用Swift重写公司OC项目(Day1)--程序的AppIcon与LaunchImage如何设置
  8. 查mysql字段中的数字记录
  9. HDU-1584 蜘蛛牌(dfs)
  10. Linux 命令 - df: 报告磁盘空间的占用情况
  11. oracle中不曾熟悉的 to_char、to_number(未完待续)
  12. 实现div中图片的滚动
  13. 浏览器扩展系列————在WPF中定制WebBrowser快捷菜单
  14. Robotium第一天:搭建环境测试微信
  15. Spring Boot启动过程(六):内嵌Tomcat中StandardHost与StandardContext的启动
  16. IIS7.5应用程序池集成模式和经典模式的区别介绍
  17. 从壹开始前后端分离 [ Vue2.0+.NET Core2.1] 二十五║初探SSR服务端渲染(个人博客二)
  18. LeetCode算法题-Design LinkedList(Java实现)
  19. 操作数据库出现InvalidOpertionException(内部连接致命错误)
  20. SQL Server中Text和varchar(max) 区别

热门文章

  1. python 爬虫过程中出现:ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接
  2. TensorFlow 中的张量,图,会话
  3. Vmware 6.5:vmware vm高可用-vSphere HA &amp; Fault Tlerance
  4. vuejs之vue和springboot后端进行通信
  5. Python - 文件读取read()、readline()、readlines()区别
  6. 调用winpcap发送路由器公告
  7. Docker / Kubernetes 镜像源
  8. Centos7 LVM扩容实例
  9. rhel6.5安装网络yum源过程
  10. NCE L5