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.
See also
PySide.QtGui.QComboBox PySide.QtGui.QFont PySide.QtGui.QFontInfo PySide.QtGui.QFontMetrics PySide.QtGui.QFontDatabase Character Map Example
Parameters: | parent – PySide.QtGui.QWidget |
---|
Constructs a font combobox with the given parent .
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 |
Return type: | PySide.QtGui.QFont |
---|
This property holds the currently selected font.
Parameters: | f – PySide.QtGui.QFont |
---|
Return type: | PySide.QtGui.QFontComboBox.FontFilters |
---|
This property holds the filter for the combobox.
By default, all fonts are listed.
Parameters: | f – PySide.QtGui.QFont |
---|
This property holds the currently selected font.
Parameters: | filters – PySide.QtGui.QFontComboBox.FontFilters |
---|
This property holds the filter for the combobox.
By default, all fonts are listed.
Parameters: | arg__1 – 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.
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.