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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QIconEngine Class Reference
[QtGui module]

The QIconEngine class provides an abstract base class for QIcon renderers. More...

 #include <QIconEngine>

Inherited by QIconEngineV2.

Public Functions

  • virtual ~QIconEngine ()
  • virtual QSize actualSize ( const QSize & size, QIcon::Mode mode, QIcon::State state )
  • virtual void addFile ( const QString & fileName, const QSize & size, QIcon::Mode mode, QIcon::State state )
  • virtual void addPixmap ( const QPixmap & pixmap, QIcon::Mode mode, QIcon::State state )
  • virtual void paint ( QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state ) = 0
  • virtual QPixmap pixmap ( const QSize & size, QIcon::Mode mode, QIcon::State state )

Detailed Description

The QIconEngine class provides an abstract base class for QIcon renderers.

Use QIconEngineV2 instead.

An icon engine provides the rendering functions for a QIcon. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.

The icon is rendered by the paint() function, and the icon can additionally be obtained as a pixmap with the pixmap() function (the default implementation simply uses paint() to achieve this). The addPixmap() function can be used to add new pixmaps to the icon engine, and is used by QIcon to add specialized custom pixmaps.

The paint(), pixmap(), and addPixmap() functions are all virtual, and can therefore be reimplemented in subclasses of QIconEngine.

See also QIconEngineV2 and QIconEnginePlugin.


Member Function Documentation

QIconEngine::~QIconEngine ()   [virtual]

Destroys the icon engine.

QSize QIconEngine::actualSize ( const QSize & size, QIcon::Mode mode, QIcon::State state )   [virtual]

Returns the actual size of the icon the engine provides for the requested size, mode and state. The default implementation returns the given size.

void QIconEngine::addFile ( const QString & fileName, const QSize & size, QIcon::Mode mode, QIcon::State state )   [virtual]

Called by QIcon::addFile(). Adds a specialized pixmap from the file with the given fileName, size, mode and state. The default pixmap-based engine stores any supplied file names, and it loads the pixmaps on demand instead of using scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra files.

void QIconEngine::addPixmap ( const QPixmap & pixmap, QIcon::Mode mode, QIcon::State state )   [virtual]

Called by QIcon::addPixmap(). Adds a specialized pixmap for the given mode and state. The default pixmap-based engine stores any supplied pixmaps, and it uses them instead of scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra pixmaps.

void QIconEngine::paint ( QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state )   [pure virtual]

Uses the given painter to paint the icon with the required mode and state into the rectangle rect.

QPixmap QIconEngine::pixmap ( const QSize & size, QIcon::Mode mode, QIcon::State state )   [virtual]

Returns the icon as a pixmap with the required size, mode, and state. The default implementation creates a new pixmap and calls paint() to fill it.

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 qtextended4.4
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