当添加"font-size"字体时,Qt Designer Point Size降至-1.在样式表中 [英] Qt Designer Point Size drops to -1 when adding "font-size" in stylesheet

查看:144
本文介绍了当添加"font-size"字体时,Qt Designer Point Size降至-1.在样式表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Qt Designer(版本5.6.2)中有问题.我已经检查了所有StyleSheets,对于所有写入其中的MainWindow来说,它们都是空的.没有字体,字体大小,字体系列等".如果我喜欢添加

I have an issue in Qt Designer (Ver 5.6.2). I have checked all StyleSheets, they are all empty exept for the one for the MainWindow where everything is written in. There is no "font, font-size, font-family etc." if i add like

#label1 {font-size: 10px;}

并运行该应用程序,控制台中将显示以下内容:

and run the app, following appears in the console:

QFont::setPointSize: Point size <= 0 (-1), must be greater than 0

好消息是,字体大小达到10 px,但我想摆脱错误.同样在我的QtDesigner应用程序中,我无法手动增加PointSize,即使您尝试增加它,它也始终保持为-1,

在ui/xml文件中出现以下内容:

the good news is, that the font size gets to 10 px but I want to get rid of the Error. also in my QtDesigner App i cant increase the PointSize manually, it always stays on -1, even if you try to increase it,

in the ui / xml file following appears:

<property name="font">
   <font>
    <pointsize>-1</pointsize>
   </font>
  </property>

有人有同样的问题吗?我如何摆脱它?

Does someone have the same issue? How can i get rid of it?

推荐答案

通过以下任一方法将其删除:

Get rid of it by either:

  1. 编辑 .ui 文件以删除愚蠢的属性值< pointsize> -1</pointsize> .

  1. Editing the .ui file to remove the silly property value <pointsize>-1</pointsize>.

将点大小恢复为默认的非覆盖值-查看您提供的屏幕截图,单击点大小"字段,然后单击将出现在此处的小还原后退箭头.p>

Restoring the point size to the default, non-overridden value - see the screenshot you provided, click on the "Point Size" field, then click on the little revert back-arrow that will appear there.

样式表不包含在其中.

这篇关于当添加"font-size"字体时,Qt Designer Point Size降至-1.在样式表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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