Changeset f87ac85f2ae4…
Parent 2ec2dca59aa0…
by
Changes to 2 files · Browse files at f87ac85f2ae4 Showing diff from parent 2ec2dca59aa0 Diff from another changeset...
@@ -153,11 +153,19 @@ def on_clicked(self, checked):
thgf = qtlib.getfont(ui.ui(), self.fname)
dlg = QFontDialog(self)
- dlg.setCurrentFont(QFont(self.value() or thgf.font()))
+ dlg.setCurrentFont(self.currentFont() or thgf.font())
if dlg.exec_() == QDialog.Accepted:
thgf.setFont(dlg.selectedFont())
self.setText(thgf.font().toString())
+ def currentFont(self):
+ """currently selected QFont if specified"""
+ if not self.value():
+ return None
+
+ f = QFont()
+ f.fromString(self.value())
+
## common APIs for all edit widgets
def setValue(self, curvalue):
|
Loading...