• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QGroupBox

    下一话题

    QFocusFrame

    QFontComboBox

    详细描述

    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() .

    调用 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 ] )
    参数: parent PySide.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.

    常量 描述
    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 ( )
    返回类型: PySide.QtGui.QFont

    This property holds the currently selected font.

    PySide.QtGui.QFontComboBox. currentFontChanged ( f )
    参数: f PySide.QtGui.QFont
    PySide.QtGui.QFontComboBox. fontFilters ( )
    返回类型: PySide.QtGui.QFontComboBox.FontFilters

    This property holds the filter for the combobox.

    By default, all fonts are listed.

    PySide.QtGui.QFontComboBox. setCurrentFont ( f )
    参数: f PySide.QtGui.QFont

    This property holds the currently selected font.

    PySide.QtGui.QFontComboBox. setFontFilters ( filters )
    参数: filters PySide.QtGui.QFontComboBox.FontFilters

    This property holds the filter for the combobox.

    By default, all fonts are listed.

    PySide.QtGui.QFontComboBox. setWritingSystem ( arg__1 )
    参数: arg__1 PySide.QtGui.QFontDatabase.WritingSystem

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

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

    PySide.QtGui.QFontComboBox. writingSystem ( )
    返回类型: PySide.QtGui.QFontDatabase.WritingSystem

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

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