本文整理匯總了Python中PyQt4.QtGui.QFontComboBox.setFontFilters方法的典型用法代碼示例。如果您正苦於以下問題:Python QFontComboBox.setFontFilters方法的具體用法?Python QFontComboBox.setFontFilters怎麽用?Python QFontComboBox.setFontFilters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QFontComboBox
的用法示例。
在下文中一共展示了QFontComboBox.setFontFilters方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: getMonospaceFontList
# 需要導入模塊: from PyQt4.QtGui import QFontComboBox [as 別名]
# 或者: from PyQt4.QtGui.QFontComboBox import setFontFilters [as 別名]
def getMonospaceFontList():
" Provides a list of strings with the system installed monospace fonts "
result = []
combo = QFontComboBox()
combo.setFontFilters(QFontComboBox.MonospacedFonts)
for index in xrange(combo.count()):
face = str(combo.itemText(index))
if face.lower() != "webdings":
result.append(face)
return result
示例2: create_fontgroup
# 需要導入模塊: from PyQt4.QtGui import QFontComboBox [as 別名]
# 或者: from PyQt4.QtGui.QFontComboBox import setFontFilters [as 別名]
def create_fontgroup(self, option=None, text=None,
tip=None, fontfilters=None):
"""Option=None -> setting plugin font"""
fontlabel = QLabel(_("Font: "))
fontbox = QFontComboBox()
if fontfilters is not None:
fontbox.setFontFilters(fontfilters)
sizelabel = QLabel(" "+_("Size: "))
sizebox = QSpinBox()
sizebox.setRange(7, 100)
self.fontboxes[(fontbox, sizebox)] = option
layout = QHBoxLayout()
for subwidget in (fontlabel, fontbox, sizelabel, sizebox):
layout.addWidget(subwidget)
layout.addStretch(1)
if text is None:
text = _("Font style")
group = QGroupBox(text)
group.setLayout(layout)
if tip is not None:
group.setToolTip(tip)
return group