eric6/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
33 """ 33 """
34 super(ColorDialogWizardDialog, self).__init__(parent) 34 super(ColorDialogWizardDialog, self).__init__(parent)
35 self.setupUi(self) 35 self.setupUi(self)
36 36
37 self.bTest = self.buttonBox.addButton( 37 self.bTest = self.buttonBox.addButton(
38 self.tr("Test"), QDialogButtonBox.ActionRole) 38 self.tr("Test"), QDialogButtonBox.ButtonRole.ActionRole)
39 39
40 msh = self.minimumSizeHint() 40 msh = self.minimumSizeHint()
41 self.resize(max(self.width(), msh.width()), msh.height()) 41 self.resize(max(self.width(), msh.width()), msh.height())
42 42
43 def on_buttonBox_clicked(self, button): 43 def on_buttonBox_clicked(self, button):
78 elif self.rRGBA.isChecked(): 78 elif self.rRGBA.isChecked():
79 QColorDialog.getColor( 79 QColorDialog.getColor(
80 QColor(self.sRed.value(), self.sGreen.value(), 80 QColor(self.sRed.value(), self.sGreen.value(),
81 self.sBlue.value(), self.sAlpha.value()), 81 self.sBlue.value(), self.sAlpha.value()),
82 None, self.eTitle.text(), 82 None, self.eTitle.text(),
83 QColorDialog.ColorDialogOptions(QColorDialog.ShowAlphaChannel)) 83 QColorDialog.ColorDialogOptions(
84 QColorDialog.ColorDialogOption.ShowAlphaChannel))
84 85
85 def on_eRGB_textChanged(self, text): 86 def on_eRGB_textChanged(self, text):
86 """ 87 """
87 Private slot to handle the textChanged signal of eRGB. 88 Private slot to handle the textChanged signal of eRGB.
88 89
148 istring, col, os.linesep) 149 istring, col, os.linesep)
149 else: 150 else:
150 code += '{0}QColor({1}),{2}'.format( 151 code += '{0}QColor({1}),{2}'.format(
151 istring, col, os.linesep) 152 istring, col, os.linesep)
152 else: 153 else:
153 code += '{0}QColor(Qt.white),{1}'.format(istring, os.linesep) 154 code += '{0}QColor(Qt.GlobalColor.white),{1}'.format(
155 istring, os.linesep)
154 code += '{0}{1},{2}'.format(istring, parent, os.linesep) 156 code += '{0}{1},{2}'.format(istring, parent, os.linesep)
155 code += '{0}self.tr("{1}"),{2}'.format( 157 code += '{0}self.tr("{1}"),{2}'.format(
156 istring, self.eTitle.text(), os.linesep) 158 istring, self.eTitle.text(), os.linesep)
157 code += ( 159 code += (
158 '{0}QColorDialog.ColorDialogOptions(' 160 '{0}QColorDialog.ColorDialogOptions('
159 'QColorDialog.ShowAlphaChannel)'.format(istring) 161 'QColorDialog.ColorDialogOption.ShowAlphaChannel)'
162 .format(istring)
160 ) 163 )
161 code += '){0}'.format(estring) 164 code += '){0}'.format(estring)
162 elif self.rRGBA.isChecked(): 165 elif self.rRGBA.isChecked():
163 code += 'getColor({0}'.format(os.linesep) 166 code += 'getColor({0}'.format(os.linesep)
164 if not self.eRGB.text(): 167 if not self.eRGB.text():
171 code += '{0}{1},{2}'.format(istring, parent, os.linesep) 174 code += '{0}{1},{2}'.format(istring, parent, os.linesep)
172 code += '{0}self.tr("{1}"),{2}'.format( 175 code += '{0}self.tr("{1}"),{2}'.format(
173 istring, self.eTitle.text(), os.linesep) 176 istring, self.eTitle.text(), os.linesep)
174 code += ( 177 code += (
175 '{0}QColorDialog.ColorDialogOptions(' 178 '{0}QColorDialog.ColorDialogOptions('
176 'QColorDialog.ShowAlphaChannel)'.format(istring) 179 'QColorDialog.ColorDialogOption.ShowAlphaChannel)'
180 .format(istring)
177 ) 181 )
178 code += '){0}'.format(estring) 182 code += '){0}'.format(estring)
179 183
180 return code 184 return code

eric ide

mercurial