简体   繁体   English

QLabel的透明背景

[英]Transparent background of QLabel

I have an application on Qt with many labels. 我在Qt上有一个带有许多标签的应用程序。 The background of each should be transparent, and on PC it is (don't mind the font size): 每个字体的背景应该是透明的,在PC上是透明的(不用担心字体大小):

Ubuntu应用程序的屏幕截图

But when I compile my app for android and run it I get this: 但是,当我为android编译我的应用并运行它时,我得到了:

Android上的th应用程序的屏幕截图

Here is how I set the transparency now: 这是我现在设置透明度的方法:
label.setStyleSheet("background: rgba(255, 0, 0, 0);");

I have also tried: 我也尝试过:
label.setStyleSheet("background: transparent;");
label.setStyleSheet("background-color: none;");

Every method works on PC and doesn't works on android. 每种方法都可以在PC上运行,而不能在android上运行。 Any suggestions? 有什么建议么?

This is apparently a bug in Qt that was reported in January. 显然,这是在一月份报告的Qt中的错误。

You can track the bug report here . 您可以在此处跟踪错误报告

It's marked as priority P2, so it's not guaranteed that it'll be fixed in the next version, but there's a chance. 它被标记为优先级P2,因此不能保证它将在下一版本中得到修复,但是仍有机会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM