def font_formatter(unknow): """ if user input is not dict/QFont, return a default QFont instance :param setting_dict: user input :return: default QFont """ _font = QFont() return _font
def _(setting_dict): """ Used for QAbstractItemModel data method for Qt.FontRole :param setting_dict: user input :return: a QFont instance with given style """ _font = QFont() _font.setUnderline(setting_dict.get('underline') or False) _font.setBold(setting_dict.get('bold') or False) _font.setItalic(setting_dict.get('italic') or False) return _font
def font_formatter(setting_dict): """ Used for QAbstractItemModel data method for Qt.FontRole :param underline: font style underline :param bold: font style bold :return: a QFont instance with given style """ _font = QFont() _font.setUnderline(setting_dict.get('underline') or False) _font.setBold(setting_dict.get('bold') or False) return _font
def font_formatter(underline=False, bold=False): """ Used for QAbstractItemModel data method for Qt.FontRole :param underline: font style underline :param bold: font style bold :return: a QFont instance with given style """ _font = QFont() _font.setUnderline(underline) _font.setBold(bold) return _font