Qt获取当前屏幕大小
2024-10-16 00:54:16
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. |
最新文章
- 解决Native atomics support not found问题
- 如何在Windows7上完全卸载Oracle 11g(转)
- ASP.NET MVC 混搭 ASP.NET WebForms 所导致的 Html.ActionLink/BeginForm 问题
- 1Z0-053 争议题目解析510
- visual studio 2013 快捷键大全
- druid 源码分析与学习(含详细监控设计思路的彩蛋)(转)
- 用Swift重写公司OC项目(Day1)--程序的AppIcon与LaunchImage如何设置
- 查mysql字段中的数字记录
- HDU-1584 蜘蛛牌(dfs)
- Linux 命令 - df: 报告磁盘空间的占用情况
- oracle中不曾熟悉的 to_char、to_number(未完待续)
- 实现div中图片的滚动
- 浏览器扩展系列————在WPF中定制WebBrowser快捷菜单
- Robotium第一天:搭建环境测试微信
- Spring Boot启动过程(六):内嵌Tomcat中StandardHost与StandardContext的启动
- IIS7.5应用程序池集成模式和经典模式的区别介绍
- 从壹开始前后端分离 [ Vue2.0+.NET Core2.1] 二十五║初探SSR服务端渲染(个人博客二)
- LeetCode算法题-Design LinkedList(Java实现)
- 操作数据库出现InvalidOpertionException(内部连接致命错误)
- SQL Server中Text和varchar(max) 区别
热门文章
- python 爬虫过程中出现:ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接
- TensorFlow 中的张量,图,会话
- Vmware 6.5:vmware vm高可用-vSphere HA &; Fault Tlerance
- vuejs之vue和springboot后端进行通信
- Python - 文件读取read()、readline()、readlines()区别
- 调用winpcap发送路由器公告
- Docker / Kubernetes 镜像源
- Centos7 LVM扩容实例
- rhel6.5安装网络yum源过程
- NCE L5