2021
03-19
03-19
pyqt5 设置窗口圆角及阴影的操作
pyqt5设置窗口圆角及阴影效果:代码如下:创建一个圆角边框的类,让后直接继承就行fromPyQt5.QtWidgetsimport*fromPyQt5.QtCoreimport*fromPyQt5.QtGuiimport*classRoundShadow(QWidget):"""圆角边框类"""def__init__(self,parent=None):super(RoundShadow,self).__init__(parent)self.border_width=8#设置窗口无边框和背景透明*必须self.setAttribute(Qt.WA_TranslucentBackground)self.setWindo...
继续阅读 >