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 options=None): |
109 """ |
109 """ |
110 Public method used by the font selection buttons. |
110 Public method used by the font selection buttons. |
111 |
111 |
112 @param fontSample reference to the font sample widget (QLineEdit) |
112 @param fontSample reference to the font sample widget (QLineEdit) |
113 @param fontVar reference to the variable containing the font (QFont) |
113 @param fontVar reference to the variable containing the font (QFont) |
115 as the sample (boolean) |
115 as the sample (boolean) |
116 @param options options for the font dialog |
116 @param options options for the font dialog |
117 (QFontDialog.FontDialogOptions) |
117 (QFontDialog.FontDialogOptions) |
118 @return selected font (QFont) |
118 @return selected font (QFont) |
119 """ |
119 """ |
|
120 if options is None: |
|
121 options = QFontDialog.FontDialogOptions(0) |
120 font, ok = QFontDialog.getFont(fontVar, self, "", options) |
122 font, ok = QFontDialog.getFont(fontVar, self, "", options) |
121 if ok: |
123 if ok: |
122 fontSample.setFont(font) |
124 fontSample.setFont(font) |
123 if showFontInfo: |
125 if showFontInfo: |
124 fontSample.setText( |
126 fontSample.setText( |