QFontComboBox Class Reference |
enum | FontFilter { AllFonts, ScalableFonts, NonScalableFonts, MonospacedFonts, ProportionalFonts } |
flags | FontFilters |
QFontComboBox ( QWidget * parent = 0 ) | |
~QFontComboBox () | |
QFont | currentFont () const |
FontFilters | fontFilters () const |
void | setFontFilters ( FontFilters filters ) |
void | setWritingSystem ( QFontDatabase::WritingSystem script ) |
QFontDatabase::WritingSystem | writingSystem () const |
virtual QSize | sizeHint () const |
void | setCurrentFont ( const QFont & font ) |
void | currentFontChanged ( const QFont & font ) |
virtual bool | event ( QEvent * e ) |
The 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.
QFontComboBox is often used in toolbars, in conjunction with a QComboBox for controlling the font size and two QToolButtons for bold and italic.
When the user selects a new font, the currentFontChanged() signal is emitted in addition to currentIndexChanged().
Call setWritingSystem() to tell QFontComboBox to show only fonts that support a given writing system, and setFontFilters() to filter out certain types of fonts as e.g. non scalable fonts or monospaced fonts.
See also QComboBox, QFont, QFontInfo, QFontMetrics, QFontDatabase, and Character Map Example.
This enum can be used to only show certain types of fonts in the font combo box.
Constant | Value | Description |
---|---|---|
QFontComboBox::AllFonts | 0 | Show all fonts |
QFontComboBox::ScalableFonts | 0x1 | Show scalable fonts |
QFontComboBox::NonScalableFonts | 0x2 | Show non scalable fonts |
QFontComboBox::MonospacedFonts | 0x4 | Show monospaced fonts |
QFontComboBox::ProportionalFonts | 0x8 | Show proportional fonts |
The FontFilters type is a typedef for QFlags<FontFilter>. It stores an OR combination of FontFilter values.
This property holds the currently selected font.
Access functions:
QFont | currentFont () const |
void | setCurrentFont ( const QFont & font ) |
Notifier signal:
void | currentFontChanged ( const QFont & font ) |
See also currentFontChanged(), currentIndex, and currentText.
This property holds the filter for the combobox.
By default, all fonts are listed.
Access functions:
FontFilters | fontFilters () const |
void | setFontFilters ( FontFilters filters ) |
See also 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.
Access functions:
QFontDatabase::WritingSystem | writingSystem () const |
void | setWritingSystem ( QFontDatabase::WritingSystem script ) |
See also fontFilters.
Constructs a font combobox with the given parent.
Destroys the combobox.
This signal is emitted whenever the current font changes, with the new font.
See also currentFont.
Reimplemented from QObject::event().
Reimplemented from QWidget::sizeHint().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com