Preferences/ConfigurationPages/ConfigurationPageBase.py

changeset 4673
6fa2418f010c
parent 4631
5c1a96925da4
child 4676
c65b401b775e
equal deleted inserted replaced
4672:67fa9b25183f 4673:6fa2418f010c
102 if self.__coloursDict[key][1]: 102 if self.__coloursDict[key][1]:
103 prefMethod(key, self.__coloursDict[key][0].name()) 103 prefMethod(key, self.__coloursDict[key][0].name())
104 else: 104 else:
105 prefMethod(key, self.__coloursDict[key][0]) 105 prefMethod(key, self.__coloursDict[key][0])
106 106
107 def selectFont(self, fontSample, fontVar, showFontInfo=False): 107 def selectFont(self, fontSample, fontVar, showFontInfo=False,
108 options=QFontDialog.FontDialogOptions(0)):
108 """ 109 """
109 Public method used by the font selection buttons. 110 Public method used by the font selection buttons.
110 111
111 @param fontSample reference to the font sample widget (QLineEdit) 112 @param fontSample reference to the font sample widget (QLineEdit)
112 @param fontVar reference to the variable containing the font (QFont) 113 @param fontVar reference to the variable containing the font (QFont)
113 @param showFontInfo flag indicating to show some font info 114 @param showFontInfo flag indicating to show some font info
114 as the sample (boolean) 115 as the sample (boolean)
116 @param options options for the font dialog
117 (QFontDialog.FontDialogOptions)
115 @return selected font (QFont) 118 @return selected font (QFont)
116 """ 119 """
117 font, ok = QFontDialog.getFont(fontVar, self) 120 font, ok = QFontDialog.getFont(fontVar, self, options=options)
118 if ok: 121 if ok:
119 fontSample.setFont(font) 122 fontSample.setFont(font)
120 if showFontInfo: 123 if showFontInfo:
121 fontSample.setText( 124 fontSample.setText(
122 "{0} {1}".format(font.family(), font.pointSize())) 125 "{0} {1}".format(font.family(), font.pointSize()))

eric ide

mercurial