http://doc.qt.io/qt-5/highdpi.html

Qt Support

  • Ability to provide pixmaps or artwork for high resolution: see Drawing High Resolution Versions of Pixmaps and Images.
  • Qt 5.4 introduces experimental support for scaling by by device pixel ratio similar to OS X to the platform plugins for Windows and Unix (XCB). This is controlled by the environment variable QT_DEVICE_PIXEL_RATIO. It can be set to a numerical value to be used as scale factor or "auto" which causes the scale factor to be determined by checking the monitor size.

    It is recommended to use the Fusion style.

Migration of Existing Applications

In order to get an application designed for low DPI values running on a high resolution monitors quickly, consider one of the scaling options (let the application run as DPI Unaware on Windows or set the environment variable QT_DEVICE_PIXEL_RATIO to "auto". These options may incur some scaling or painting artifacts, though.

In the longer term, the application should be adapted to run unmodified:

  • Always use the qreal versions of the QPainter drawing API.
  • Size windows and dialogs in relation to the screen size.
  • Replace hard-coded sizes in layouts and drawing code by values calculated from font metrics or screen size.

Qt high DPI的更多相关文章

  1. QT的DPI支持

    在main函数第一行加入: QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 鼠标不按下也响应移动事件: setMouseTra ...

  2. Qt之高DPI显示器(一) - 解决方案整理

    目录 DPI发展 1.PPI 2.DPI 一.Win自适应系统 二.Qt机制 1.Windows系统DWM缩放 2. Qt适配高DPI 3.适配DPI结论 三.Qt适配 四.自己适配 1.窗口大小 2 ...

  3. 【Qt开发】【ARM-Linux开发】 QT在ARM上显示字体的问题

    在PC机上利用QT开发的应用程序在设置字体时,在PC上运行,可根据自己的设置,字体随之变大或变小.而移植到ARM上运行时发现,显示字体与所设置的字体不用,字体普遍偏小.经过上网搜索发现,是环境变量字库 ...

  4. blade 已开源

    https://github.com/crazii 开源的主要原因是一个人写不动了, 而且已经很久没更新代码了. 希望有人能够感兴趣, 提供贡献. 距离上次更新日志已经很久了, 中间大概加了以下fea ...

  5. Qt之高DPI显示器(二) - 自适配解决方案分析

    目录 一.回顾 二.框架说明 1.ICallDPIChanged 2.IDPIHelper 3.悬浮窗体管理器 三.方案分析 1.窗口大小 2.字体大小 3.间距 4.图标 四.相关文章 原文链接:Q ...

  6. Qt on Android:创建可伸缩界面

    使用 Qt 来开发 Android 应用,也需要适配不同移动设备,适配多种多样的屏幕和分辨率.这次我们大概来讲一下如何使用 Qt 提供的机制来创建可伸缩的界面. DPI 必须要解释一下 DPI . D ...

  7. 《Qt Quick 4小时入门》学习笔记

    http://edu.csdn.net/course/detail/1042/14804?auto_start=1   Qt Quick 4小时入门 第五章:Qt Quick里的信号与槽   QML中 ...

  8. Qt之坐标系统

    简述 坐标系统是由QPainter类控制的,再加上QPaintDevice和QPaintEngine类,就形成了Qt的绘图体系. QPainter:用于执行绘图操作. QPaintDevice:二维空 ...

  9. 是什么让 Ubuntu 选用 Qt 而不是 GTK?

    是什么让 Ubuntu 选用 Qt 而不是 GTK? 一个正在发生的事实,Ubuntu正在不断Qt化!我曾一直在抱怨的Software Center,今日一看源码,竟然有softwarecenter/ ...

随机推荐

  1. windows 并发与同步 学习笔记

    测试 5.2 windows 中断与异常 1.外部硬件中断是通过处理器上的中断引脚管或者本地APIC的内置模块来发生的:对于一个处理器,一旦被中单, 某个预先被设定的中断服务例程就被执行! 2.处理器 ...

  2. 概率 Gym 100502D Dice Game

    题目传送门 /* 题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布 问两人投掷,胜利的概率谁大 数据小,用4个for 把所有的可能性都枚举一遍,统计每一次是谁胜利 还有更简单的做 ...

  3. 最短路(Floyd_Warshall) POJ 2253 Frogger

    题目传送门 /* 最短路:Floyd算法模板题 */ #include <cstdio> #include <iostream> #include <algorithm& ...

  4. flst与fitem命令是这么用的

    k,94,75.69947,44.09817,-40 k,95,50.9349,44.01963,-40 k,96,37.83799,45.04814,-40 k,97,15.1304,48.2934 ...

  5. 排列组合[HDU1521]

    排列组合 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  6. 【BZOJ】1049: [HAOI2006]数字序列(lis+特殊的技巧)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1049 题意:给一个长度为n的整数序列.把它变成一个单调严格上升的序列.但是不希望改变过多的数,也不希 ...

  7. JSON.stringify语法解析(自己留存)

    语法: JSON.stringify(value [, replacer] [, space]) value:是必选字段.就是你输入的对象,比如数组,类等. replacer:这个是可选的.它又分为2 ...

  8. 李洪强-C语言3-数组

    一.数组的概念 用来存储一组数据的构造数据类型 特点:只能存放一种类型的数据,如全部是int型或者全部是char型,数组里的数据成为元素. 二.数组的定义 格式: 类型 数组名[元素个数]: 举例:存 ...

  9. python的几个常用内置函数

    dir()查看属性(函数和数据对象) help()查看具体的帮助文档 id() 用来查看数据对象的地址 split 分隔(str ---> list): >>> s=" ...

  10. lucene 3.0.2 操作进阶

    转自:Bannings http://blog.csdn.net/zhangao0086/article/details/ Analyzer(分词器) 分词器能以某种规则对关键字进行分词,将分好的词放 ...