设置标签背景透明

问题描述

我想让标签的“背景”透明,所以我可以放一个模糊的边框,但我不知道如何让它消失。

这里有一个小问题...:

Here is the little problem...

标签代码如下:

self.lb = QLabel(self)
self.lb.setwindowFlags(Qt.ToolTip)
rand_img = self.my_images[randint(0,len(self.my_images)-1)]
print(rand_img + " loaded")
self.lb.setStyleSheet("background-image: url(images/"+rand_img+");\
                        background-repeat: no-repeat;\
                        background-origin:padding-Box;\
                        color:white;\
                        border-style: ridge;\
                        border-width: 20px;\
                        border-color: rgb(0,50%);\
                        border-radius: 25px;\
                        font: 16px;\
                        font-weight: bold;\
                        font-family: 'Consolas';\
                        min-width: 10em;\
                        padding: 10px;")

self.lb.setText('> Ready!\n> Paused...')
self.lb.show()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)