def load_font(self, initialFont): print initialFont.key() font, ok = QFontDialog(initialFont).getFont() if ok: newFont = font.toString().split(',') return newFont[0] + ', ' + newFont[1] else: return initialFont
def btnLabelFontClick(self): dlgFont = QFontDialog(self) dlgFont.setCurrentFont(self.selectedLabelItem.font()) result = dlgFont.exec_() if result == 1: self.labelFont = dlgFont.selectedFont() else: self.labelFont = QFont() self.selectedLabelItem.setFont(self.labelFont)
def changeFont_Callback(self): dialog = QFontDialog() title = "Please select font" newFont, ok = dialog.getFont(QFont(self.historTableFontFamily, self.historTableFontSize), self, title) if (ok): self.historTableFontFamily = newFont.family() self.historTableFontSize = newFont.pointSize() self.historyTableView.setFont(newFont) self.displayHistoryTableFont(newFont.family(), newFont.pointSize())
def on_btnFont_clicked(self): fd = QFontDialog(self) if fd.exec_(): self.setEditorFont(fd.selectedFont())