QIcon Class Reference
|
Константа | Значение | Описание |
---|---|---|
QIcon::Normal | 0 | Выводит на экран растровое изображение, когда пользователь не взаимодействует с пиктограммой, но доступна функциональность, предоставляемая пиктограммой. |
QIcon::Disabled | 1 | Выводимое на экран растровое изображение, когда функциональность, предоставляемая пиктограммой, не доступна. |
QIcon::Active | 2 | Выводимое на экран растровое изображение когда функциональность предоставляемая пиктограммой доступна и пользователь взаимдействует с пиктограммой, например, перемещает мышь поверх неё или щелкает по ней. |
QIcon::Selected | 3 | Display the pixmap when the item represented by the icon is selected. |
This enum describes the state for which a pixmap is intended to be used. The state can be:
Константа | Значение | Описание |
---|---|---|
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.
Создаёт копию other. This is very fast.
Constructs an icon from the file with the given fileName. The file will be loaded on demand.
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.
Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.
Creates an icon with a specific icon engine. The icon takes ownership of the engine.
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 an image 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.
Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.
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 a number that identifies the contents of this QIcon object. Distinct QIcon objects can have the same key if they refer to the same contents.
The cacheKey() will change when the icon is altered via addPixmap() or addFile().
Cache keys are mostly useful in conjunction with caching.
Эта функция была введена в Qt 4.3.
See also QPixmap::cacheKey().
Returns true if the icon is empty; otherwise returns false.
An icon is empty if it has neither a pixmap nor a filename.
Note: Even a non-null icon might not be able to create valid pixmaps, eg. if the file does not exist or cannot be read.
Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.
See also actualSize() and pixmap().
Это перегруженная функция, предоставленная для удобства.
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().
Это перегруженная функция, предоставленная для удобства.
Returns a pixmap of size QSize(w, h). The pixmap might be smaller than requested, but never larger.
Это перегруженная функция, предоставленная для удобства.
Returns a pixmap of size QSize(extent, extent). The pixmap might be smaller than requested, but never larger.
Returns the icon as a QVariant.
Assigns the other icon to this icon and returns a reference to this icon.
Это перегруженная функция, предоставленная для удобства.
Writes the given icon to the the given stream as a PNG image. If the icon contains more than one image, all images will be written to the stream. Note that writing the stream to a file will not produce a valid image file.
Эта функция была введена в Qt 4.2.
Это перегруженная функция, предоставленная для удобства.
Reads an image, or a set of images, from the given stream into the given icon.
Эта функция была введена в Qt 4.2.
Copyright © 2008 Nokia | Торговые марки | Qt 4.4.3 |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |