Table Of Contents

Previous topic

QGroupBox

Next topic

QFocusFrame

QFontComboBox

Synopsis

Functions

Slots

Signals

Detailed Description

The PySide.QtGui.QFontComboBox widget is a combobox that lets the user select a font family.

The combobox is populated with an alphabetized list of font family names, such as Arial, Helvetica, and Times New Roman. Family names are displayed using the actual font when possible. For fonts such as Symbol, where the name is not representable in the font itself, a sample of the font is displayed next to the family name.

PySide.QtGui.QFontComboBox is often used in toolbars, in conjunction with a PySide.QtGui.QComboBox for controlling the font size and two PySide.QtGui.QToolButton s for bold and italic.

When the user selects a new font, the PySide.QtGui.QFontComboBox.currentFontChanged() signal is emitted in addition to PySide.QtGui.QComboBox.currentIndexChanged() .

Call PySide.QtGui.QFontComboBox.setWritingSystem() to tell PySide.QtGui.QFontComboBox to show only fonts that support a given writing system, and PySide.QtGui.QFontComboBox.setFontFilters() to filter out certain types of fonts as e.g. non scalable fonts or monospaced fonts.

../../_images/windowsxp-fontcombobox.png
class PySide.QtGui.QFontComboBox([parent=None])
Parameters:parentPySide.QtGui.QWidget

Constructs a font combobox with the given parent .

PySide.QtGui.QFontComboBox.FontFilter

This enum can be used to only show certain types of fonts in the font combo box.

Constant Description
QFontComboBox.AllFonts Show all fonts
QFontComboBox.ScalableFonts Show scalable fonts
QFontComboBox.NonScalableFonts Show non scalable fonts
QFontComboBox.MonospacedFonts Show monospaced fonts
QFontComboBox.ProportionalFonts Show proportional fonts
PySide.QtGui.QFontComboBox.currentFont()
Return type:PySide.QtGui.QFont

This property holds the currently selected font.

PySide.QtGui.QFontComboBox.currentFontChanged(f)
Parameters:fPySide.QtGui.QFont
PySide.QtGui.QFontComboBox.fontFilters()
Return type:PySide.QtGui.QFontComboBox.FontFilters

This property holds the filter for the combobox.

By default, all fonts are listed.

PySide.QtGui.QFontComboBox.setCurrentFont(f)
Parameters:fPySide.QtGui.QFont

This property holds the currently selected font.

PySide.QtGui.QFontComboBox.setFontFilters(filters)
Parameters:filtersPySide.QtGui.QFontComboBox.FontFilters

This property holds the filter for the combobox.

By default, all fonts are listed.

PySide.QtGui.QFontComboBox.setWritingSystem(arg__1)
Parameters:arg__1PySide.QtGui.QFontDatabase.WritingSystem

This property holds the writing system that serves as a filter for the combobox.

If script is QFontDatabase.Any (the default), all fonts are listed.

PySide.QtGui.QFontComboBox.writingSystem()
Return type:PySide.QtGui.QFontDatabase.WritingSystem

This property holds the writing system that serves as a filter for the combobox.

If script is QFontDatabase.Any (the default), all fonts are listed.