设置标签背景透明

时间:2021-06-29 04:14:09

标签: python pyqt5 qtstylesheets

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

这里有一个小问题...:
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,0,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()

0 个答案:

没有答案