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. android 进程什么时候被销毁

    http://wear.techbrood.com/guide/components/processes-and-threads.html 每一个 android 应用默认会起一个进程,除非你用 an ...

  2. Codeforces 176B (线性DP+字符串)

    题目链接: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=28214 题目大意:源串有如下变形:每次将串切为两半,位置颠倒形成 ...

  3. Android解析XML(PULL方式)

    PULL 的工作原理: XML pull提供了开始元素和结束元素.当某个元素开始时,可以调用parser.nextText从XML文档中提取所有字符数据.当解析到一个文档结束时,自动生成EndDocu ...

  4. CC150 - 11.3

    Question: Given a sorted array of n integers that has been rotated an unknown number of times, write ...

  5. BestCoder Round #74

    身败名裂啊...... T1WA了半天,30min才A. T2又WA了一发,然后Hack刚2min就被别人叉了. T3做完后最后40min不知所措. 去叉别人,看到一个人写D题判m=0很奇怪,随手把他 ...

  6. PS如何查找自己想要的字体

    曾经很多人问我,这是什么字体,答曰:“不知道”,自己平时在作图时也经常会遇到这样的问题,于是我就把文字打出来,然后比照PS里边已经导入的字体挨个试验,这样不仅浪费了大量的时间和精力,而且比对完后,各种 ...

  7. lvs原理和实战

     lvs-dr原理 lvs-nat原理:  当我们的网站流量越来越大时一台web服务器已经无法满足需求了,我们该如何解决呢??把服务器连接起来实现负载均衡或许是个不错的办法..下面我就来看看怎么实现吧 ...

  8. thinkphp的html模板中if的使用

    写的时候正好出错,我就纠结是{if}还是手册中的<if condition>,当然我使用的是手册中的用法,但是点击按钮时候还是没展开(if后的条件没执行).如图 试了好多写法,也检查了多次 ...

  9. HP StorageWorks MSL2024 Tape Libraries - Tape library Error Codes

    Main error codes Error Code Description Details and Solution 80 Can not initialize bar code reader P ...

  10. Windows系统中Git的安装配置

    一.Git安装 1.下载 Git官网:https://git-scm.com/download/ 选择windows版本下载即可. 百度软件中心:http://rj.baidu.com/ 如官网下载不 ...