MainWindow.setWindowOpacity(0.85) # 设置窗口透明度 MainWindow.setAttribute(QtCore.Qt.WA_TranslucentBackground) # 设置窗口背景透明