在Mac OS X上QT框架QML应用程序字体太小 [英] QT Framework QML Application fonts too small on Mac OS X

查看:300
本文介绍了在Mac OS X上QT框架QML应用程序字体太小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个QT应用程序,在QML中设置字体和大小



在windows和linux上,它工作正常。但是,在OS X文本显示太小。这是别人写的东西。它使用Segoe UI字体。正如我在QT 4.7中所理解的那样,我可以指定昏迷字体。然而,定义的点大小似乎仍然太小。

有什么我可以做,以解决这个问题,而不改变这种方式看起来在其他平台上?如果你使用 font.pointSize 来设置字体的大小,那么你可以使用 由此产生的像素大小取决于设备或更一般地说,屏幕的dpi(据系统知道它)。

这意味着,如果你真的意味着字体具有相同的像素大小,无论屏幕的dpi是多少,那么您应该使用 font.pixelSize 来设置字体的大小。


I have a QT application where font family and size is set in QML

On windows and linux it works fine. However, on OS X text appears too small. This is something that someone else wrote. It uses Segoe UI font. As I understand in QT 4.7 I can assign fallback fonts with a coma. However the defined point sizes still seem to be too small.

Is there something I can do to fix this issue without changing the way how this looks on other platforms?

解决方案

If you use font.pointSize to set the size of the font then the resulting pixel size depends on the device or more generally, the dpi of the screen (as far as the system is aware of it).

This means that if you really meant the font to have the same pixel size, whatever the dpi of the screen, then you should be using font.pixelSize to set the size of your fonts instead.

这篇关于在Mac OS X上QT框架QML应用程序字体太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆