写了一个感觉有些用的小玩具。
用于给控件添加阴影遮罩(强调主控件的同时屏蔽其余控件的点击)
自定义阴影遮罩Mask:
from PyQt5.QtCore import QPoint,QRect,Qt,QPoint,QSize
from PyQt5.QtWidgets import QWidget,QLabel,QPushButton,QVBoxLayout
from PyQt5.QtGui import QColor,QPainter,QBitmap
class Mask(QWidget):
__exclude=None
__color=None
def __init__(self,parent=None,*exclude,color=QColor(0,0,0,128)):
super().__init__(parent)
self.__exclude=set(exclude)
self.__color=color
self.show()