QIcon Class Reference |
Constant | Value | Description |
---|---|---|
QIcon::Normal | 0 | Display the pixmap when the user is not interacting with the icon, but the functionality represented by the icon is available. |
QIcon::Disabled | 1 | Display the pixmap when the functionality represented by the icon is not available. |
QIcon::Active | 2 | Display the pixmap when the functionality represented by the icon is available and the user is interacting with the icon, for example, moving the mouse over it or clicking it. |
This enum describes the state for which a pixmap is intended to be used. The state can be:
Constant | Value | Description |
---|---|---|
QIcon::Off | 1 | Display the pixmap when the widget is in an "off" state |
QIcon::On | 0 | Display the pixmap when the widget is in an "on" state |
Constructs a null icon.
Constructs an icon from a pixmap.
Constructs a copy of other. This is very fast.
Constructs an icon from the file with the given fileName. The file will be loaded on demand. If the file does not exist or is of an unknown format, the icon becomes a null icon.
If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.
The file name can be either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.
Creates an icon with a specific icon engine. The icon takes ownership of the engine.
Destroys the icon.
Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger.
See also pixmap() and paint().
Adds a pixmap from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.
If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.
The file name can be either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.
See also addPixmap().
Adds pixmap to the icon, as a specialization for mode and state.
Custom icon engines are free to ignore additionally added pixmaps.
See also addFile().
Returns true if the icon is empty; otherwise returns false.
A null icon is an icon that was created using the default constructor.
Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.
See also actualSize() and pixmap().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Paints the icon into the rectangle QRect(x, y, w, h).
Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.
See also setPixmap(), actualSize(), and paint().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns a pixmap of size QSize(w, h).
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns a pixmap of size QSize(extent, extent).
Returns a number that uniquely identifies the contents of this QIcon object. This means that multiple QIcon objects can have the same serial number as long as they refer to the same contents.
A null icon always has a serial number of 0.
See also QPixmap::serialNumber().
Returns the icon as a QVariant.
Assigns the other icon to this icon and returns a reference to this icon.
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.0 | |
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