当前位置:网站首页>QML fonts use pixelsize to adapt to the interface
QML fonts use pixelsize to adapt to the interface
2022-07-08 01:43:00 【Fu_ Lin_】
Preface
Has been plagued by the problem of font adaptation , Especially in use pixelSize Unit font , Different effects will be displayed on computers with different resolutions , Some are big , Some are medium , Some thieves are small , This is because of the use of pixelSize It will cause the font to be fixed , How big is most , It won't change by itself , When it comes to high resolution, it becomes smaller , The low one is the thief , Just like the design prototype , It looks very beautiful .
While using pointSize Although it will zoom in and out by itself , But there is a big gap with the font of the design , And there will be corresponding problems , And I prefer to use pixelSize
, Now that it's fixed , I can zoom in and out by myself according to the proportion , So the key point of this paper is how to obtain the zoom in and zoom out ratio , Make pixel fonts look medium good on any device !
Ideas
To get the font scaling factor , You have to know that the width and height of the original pixels are compared with the original pixels of the current device , Get different width height ratio values , Get the minimum , This is the scaling factor , Then multiply by the current font size , You can scale the font proportionally , Of course, you can also add a scaling base factor , Initialize to 1, This needs artificial adjustment , There may be 1 Not very good. , It needs to be adjusted to 1.1 It will be better , The specific acquisition code is given below
horizontalRatio = Changing U
边栏推荐
- 2022 safety officer-c certificate examination paper and safety officer-c certificate simulated examination question bank
- 用户之声 | 冬去春来,静待花开 ——浅谈GBase 8a学习感悟
- [SolidWorks] modify the drawing format
- Qt - - Packaging Programs - - Don't install Qt - can run directly
- NPM Internal Split module
- nacos-微服务网关Gateway组件 +Swagger2接口生成
- npm 内部拆分模块
- 2、TD+Learning
- Anaconda3 tutorial on installing and adding Tsinghua image files
- Redis master-slave replication
猜你喜欢
The solution of frame dropping problem in gnuradio OFDM operation
Write a pure handwritten QT Hello World
About how USRP sets the sampling frequency below the minimum sampling frequency reached by the hardware
3. Multi agent reinforcement learning
Kindle operation: transfer downloaded books and change book cover
Anaconda3 download address Tsinghua University open source software mirror station
Sword finger offer II 041 Average value of sliding window
Gnuradio3.9.4 create OOT module instances
qt-使用自带的应用框架建立--hello world--使用min GW 32bit
redis的持久化方式-RDB和AOF 两种持久化机制
随机推荐
[loss function] entropy / relative entropy / cross entropy
Deep learning website
2022 low voltage electrician examination content and low voltage electrician simulation examination question bank
5、離散控制與連續控制
Introduction to natural language processing (NLP) based on transformers
The difference between distribution function and probability density function of random variables
Redis cluster
Redis集群
Sum of submatrix
qt--将程序打包--不要安装qt-可以直接运行
项目经理有必要考NPDP吗?我告诉你答案
Qml 字体使用pixelSize来自适应界面
break algorithm---刷题map
ROS problems (topic types do not match, topic datatype/md5sum not match, MSG XXX have changed. rerun cmake)
break net
Is it safe to open an account on your mobile phone for small amount of stock speculation?
正则表达式
common commands
Codeforces Round #649 (Div. 2)——A. XXXXX
Matlab method is good~