QFontComboBox¶
The
QFontComboBox
widget is a combobox that lets the user select a font family. More…
Synopsis¶
Functions¶
def
currentFont
()def
fontFilters
()def
setFontFilters
(filters)def
setWritingSystem
(arg__1)def
writingSystem
()
Slots¶
def
setCurrentFont
(f)
Signals¶
def
currentFontChanged
(f)
Detailed Description¶
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.
QFontComboBox
is often used in toolbars, in conjunction with aQComboBox
for controlling the font size and twoQToolButton
s for bold and italic.When the user selects a new font, the
currentFontChanged()
signal is emitted in addition tocurrentIndexChanged()
.Call
setWritingSystem()
to tellQFontComboBox
to show only fonts that support a given writing system, andsetFontFilters()
to filter out certain types of fonts as e.g. non scalable fonts or monospaced fonts.See also
QComboBox
QFont
QFontInfo
QFontMetrics
QFontDatabase
Character Map Example
- class PySide2.QtWidgets.QFontComboBox([parent=None])¶
- param parent:
Constructs a font combobox with the given
parent
.
- PySide2.QtWidgets.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
- PySide2.QtWidgets.QFontComboBox.currentFont()¶
- Return type:
This property holds the currently selected font.
See also
- PySide2.QtWidgets.QFontComboBox.currentFontChanged(f)¶
- Parameters:
- PySide2.QtWidgets.QFontComboBox.fontFilters()¶
- Return type:
FontFilters
This property holds the filter for the combobox.
By default, all fonts are listed.
See also
- PySide2.QtWidgets.QFontComboBox.setCurrentFont(f)¶
- Parameters:
This property holds the currently selected font.
See also
- PySide2.QtWidgets.QFontComboBox.setFontFilters(filters)¶
- Parameters:
filters –
FontFilters
This property holds the filter for the combobox.
By default, all fonts are listed.
See also
- PySide2.QtWidgets.QFontComboBox.setWritingSystem(arg__1)¶
- Parameters:
arg__1 –
WritingSystem
This property holds the writing system that serves as a filter for the combobox.
If
script
isAny
(the default), all fonts are listed.See also
- PySide2.QtWidgets.QFontComboBox.writingSystem()¶
- Return type:
This property holds the writing system that serves as a filter for the combobox.
If
script
isAny
(the default), all fonts are listed.See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.