Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QFontComboBox Class Reference
[QtGui module]

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

 #include <QFontComboBox>

Inherits QComboBox.

This class was introduced in Qt 4.2.

Public Types

  • enum FontFilter { AllFonts, ScalableFonts, NonScalableFonts, MonospacedFonts, ProportionalFonts }

Properties

Public Functions

  • 54 public functions inherited from QComboBox
  • 195 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 12 public functions inherited from QPaintDevice

Public Slots

  • 4 public slots inherited from QComboBox
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Signals

Additional Inherited Members

  • 4 static public members inherited from QWidget
  • 5 static public members inherited from QObject
  • 38 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

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.

Screenshot of QFontComboBox on Windows XP

See also QComboBox, QFont, QFontInfo, QFontMetrics, QFontDatabase, and Character Map Example.


Member Type Documentation

enum QFontComboBox::FontFilter
flags QFontComboBox::FontFilters

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

ConstantValueDescription
QFontComboBox::AllFonts0Show all fonts
QFontComboBox::ScalableFonts0x1Only show scalable fonts
QFontComboBox::NonScalableFonts0x2Only show non scalable fonts
QFontComboBox::MonospacedFonts0x4Only show monospaced fonts
QFontComboBox::ProportionalFonts0x8Only show proportional fonts

The FontFilters type is a typedef for QFlags<FontFilter>. It stores an OR combination of FontFilter values.


Property Documentation

currentFont : QFont

This property holds the currently selected font.

Access functions:

  • QFont currentFont () const
  • void setCurrentFont ( const QFont & font )

See also currentFontChanged(), currentIndex, and currentText.

fontFilters : FontFilters

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.

writingSystem : 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.

Access functions:

  • QFontDatabase::WritingSystem writingSystem () const
  • void setWritingSystem ( QFontDatabase::WritingSystem script )

See also fontFilters.


Member Function Documentation

QFontComboBox::QFontComboBox ( QWidget * parent = 0 )

Constructs a font combobox with the given parent.

QFontComboBox::~QFontComboBox ()

Destroys the combobox.

void QFontComboBox::currentFontChanged ( const QFont & font )   [signal]

This signal is emitted whenever the current font changes, with the new font.

See also currentFont.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.2
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 !
 
 
 
 
Partenaires

Hébergement Web