Plugins/WizardPlugins/FontDialogWizard/FontDialogWizardDialog.py

changeset 3124
a01e410893ac
parent 2893
150de635fa29
child 3125
385a62b53725
equal deleted inserted replaced
3123:2c89ff79c246 3124:a01e410893ac
90 @return generated code (string) 90 @return generated code (string)
91 """ 91 """
92 estring = os.linesep + indLevel * indString 92 estring = os.linesep + indLevel * indString
93 93
94 # generate the code 94 # generate the code
95 code = 'QFontDialog.getFont(' 95 resvar = self.eResultVar.text()
96 if not resvar:
97 resvar = "font"
98 code = '{0}, ok = QFontDialog.getFont('.format(resvar)
96 if not self.eVariable.text(): 99 if not self.eVariable.text():
97 if self.font is not None: 100 if self.font is not None:
98 code += 'QFont("{0}", {1:d}, {2:d}, {3:d})'.format( 101 code += 'QFont("{0}", {1:d}, {2:d}, {3:d})'.format(
99 self.font.family(), self.font.pointSize(), 102 self.font.family(), self.font.pointSize(),
100 self.font.weight(), self.font.italic()) 103 self.font.weight(), self.font.italic())

eric ide

mercurial