简体   繁体   中英

Transparent background of QLabel

I have an application on Qt with many labels. The background of each should be transparent, and on PC it is (don't mind the font size):

Ubuntu应用程序的屏幕截图

But when I compile my app for android and run it I get this:

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. Any suggestions?

This is apparently a bug in Qt that was reported in January.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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