qt 字体不随dpi,更改显示器的DPI缩放大小会使Qt应用程序的字体大小变大

当显示器DPI缩放比例改变时,Qt应用程序的字体大小会随之变大,但控件尺寸不变,导致文字显示不全。在Qt 5.6及以上版本,可以通过设置QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling)来启用自动高DPI缩放。此设置需要在创建QApplication对象之前进行。
摘要由CSDN通过智能技术生成

I have created some GUI application using Qt. My GUI application contains controls like push button and radio button. When I run the application, buttons and fonts inside button looks normal. When I change the DPI scaling size of display from 100% to 150% or 200%, font size of controls rendered bigger but not control size (pushbutton, radio button) irrespective of resolution. Due to this the text inside controls were cut off. please see the attached image.

Qt application look when DPI scaling size set to 100%

jtWS8.png

Qt application look when DPI scaling size set to 200%

pQsV8.png

I am running my application in some tablets also. In tablets, DPI scale value should be more than 150% else everything will be shown very small

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值