【PyQt5学习】——颜色面板使用(QcolorDialog),索爱w610c
0evadmin
编程语言
5
文件名:【PyQt5学习】——颜色面板使用(QcolorDialog),索爱w610c
【PyQt5学习】——颜色面板使用(QcolorDialog)
from PyQt5.QtGui import *from PyQt5.QtCore import *from PyQt5.QtWidgets import *BB = QDialogButtonBox# 颜色窗口class ColorDialog(QColorDialog):def __init__(self, parent=None):super(ColorDialog, self).__init__(parent)self.setOption(QColorDialog.ShowAlphaChannel)# The Mac native dialog does not support our restore button.self.setOption(QColorDialog.DontUseNativeDialog)# Add a restore defaults button.# The default is set at invocation time, so that it# works across dialogs for different elements.self.default = Noneself.bb = self.layout().itemAt(1).widget()self.bb.addButton(BB.RestoreDe
同类推荐