Qt 4.8
Public Functions | Public Variables | List of all members
QPixmapCacheEntry Class Reference

#include <qpixmapcache_p.h>

Inheritance diagram for QPixmapCacheEntry:
QPixmap QPaintDevice

Public Functions

 QPixmapCacheEntry (const QPixmapCache::Key &key, const QPixmap &pix)
 
 ~QPixmapCacheEntry ()
 
- Public Functions inherited from QPixmap
QT_DEPRECATED QPixmap alphaChannel () const
 Returns the alpha channel of the pixmap as a new grayscale QPixmap in which each pixel's red, green, and blue values are given the alpha value of the original pixmap. More...
 
qint64 cacheKey () const
 Returns a number that identifies this QPixmap. More...
 
QRgbclut () const
 
int colorCount () const
 
bool convertFromImage (const QImage &img, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Replaces this pixmap's data with the given image using the specified flags to control the conversion. More...
 
QPixmap copy (int x, int y, int width, int height) const
 Returns a deep copy of the subset of the pixmap that is specified by the rectangle QRect( x, y, width, height). More...
 
QPixmap copy (const QRect &rect=QRect()) const
 Returns a deep copy of the subset of the pixmap that is specified by the given rectangle. More...
 
QBitmap createHeuristicMask (bool clipTight=true) const
 Creates and returns a heuristic mask for this pixmap. More...
 
QBitmap createMaskFromColor (const QColor &maskColor) const
 Creates and returns a mask for this pixmap based on the given maskColor. More...
 
QBitmap createMaskFromColor (const QColor &maskColor, Qt::MaskMode mode) const
 Creates and returns a mask for this pixmap based on the given maskColor. More...
 
DataPtrdata_ptr ()
 
int depth () const
 Returns the depth of the pixmap. More...
 
void detach ()
 Detaches the pixmap from shared pixmap data. More...
 
int devType () const
 
void fill (const QColor &fillColor=Qt::white)
 Fills the pixmap with the given color. More...
 
void fill (const QWidget *widget, const QPoint &ofs)
 Fills the pixmap with the widget's background color or pixmap according to the given offset. More...
 
void fill (const QWidget *widget, int xofs, int yofs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Fills the pixmap with the widget's background color or pixmap. More...
 
Qt::HANDLE handle () const
 Returns the pixmap's handle to the device context. More...
 
bool hasAlpha () const
 Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false. More...
 
bool hasAlphaChannel () const
 Returns true if the pixmap has a format that respects the alpha channel, otherwise returns false. More...
 
int height () const
 Returns the height of the pixmap. More...
 
bool isDetached () const
 
bool isNull () const
 Returns true if this is a null pixmap; otherwise returns false. More...
 
bool isQBitmap () const
 Returns true if this is a QBitmap; otherwise returns false. More...
 
bool load (const QString &fileName, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Loads a pixmap from the file with the given fileName. More...
 
bool loadFromData (const uchar *buf, uint len, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Loads a pixmap from the len first bytes of the given binary data. More...
 
bool loadFromData (const QByteArray &data, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a pixmap from the binary data using the specified format and conversion flags. More...
 
QBitmap mask () const
 Extracts a bitmap mask from the pixmap's alpha channel. More...
 
QT_DEPRECATED int numCols () const
 
 operator QVariant () const
 Returns the pixmap as a QVariant. More...
 
bool operator! () const
 Returns true if this is a null pixmap; otherwise returns false. More...
 
QPixmapoperator= (const QPixmap &)
 Assigns the given pixmap to this pixmap and returns a reference to this pixmap. More...
 
QPaintEnginepaintEngine () const
 
QPixmapDatapixmapData () const
 
 QPixmap ()
 Constructs a null pixmap. More...
 
 QPixmap (QPixmapData *data)
 
 QPixmap (int w, int h)
 Constructs a pixmap with the given width and height. More...
 
 QPixmap (const QSize &)
 Constructs a pixmap of the given size. More...
 
 QPixmap (const QString &fileName, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Constructs a pixmap from the file with the given fileName. More...
 
 QPixmap (const char *const xpm[])
 Constructs a pixmap from the given xpm data, which must be a valid XPM image. More...
 
 QPixmap (const QPixmap &)
 Constructs a pixmap that is a copy of the given pixmap. More...
 
const ucharqwsBits () const
 
int qwsBytesPerLine () const
 
QRect rect () const
 Returns the pixmap's enclosing rectangle. More...
 
bool save (const QString &fileName, const char *format=0, int quality=-1) const
 Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. More...
 
bool save (QIODevice *device, const char *format=0, int quality=-1) const
 This function writes a QPixmap to the given device using the specified image file format and quality factor. More...
 
QPixmap scaled (int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QPixmap scaled (const QSize &s, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QPixmap scaledToHeight (int h, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QPixmap scaledToWidth (int w, Qt::TransformationMode mode=Qt::FastTransformation) const
 Returns a scaled copy of the image. More...
 
void scroll (int dx, int dy, int x, int y, int width, int height, QRegion *exposed=0)
 
void scroll (int dx, int dy, const QRect &rect, QRegion *exposed=0)
 Scrolls the area rect of this pixmap by (dx, dy). More...
 
QT_DEPRECATED int serialNumber () const
 Returns a number that identifies the contents of this QPixmap object. More...
 
QT_DEPRECATED void setAlphaChannel (const QPixmap &)
 Sets the alpha channel of this pixmap to the given alphaChannel by converting the alphaChannel into 32 bit and using the intensity of the RGB pixel values. More...
 
void setMask (const QBitmap &)
 Sets a mask bitmap. More...
 
QSize size () const
 Returns the size of the pixmap. More...
 
void swap (QPixmap &other)
 Swaps pixmap other with this pixmap. More...
 
QImage toImage () const
 Converts the pixmap to a QImage. More...
 
CGImageRef toMacCGImageRef () const
 Creates a CGImageRef equivalent to the QPixmap. More...
 
HBITMAP toWinHBITMAP (HBitmapFormat format=NoAlpha) const
 It is the caller's responsibility to free the HBITMAP data after use. More...
 
HICON toWinHICON () const
 Returns the HICON handle. More...
 
QPixmap transformed (const QMatrix &, Qt::TransformationMode mode=Qt::FastTransformation) const
 This convenience function loads the matrix into a QTransform and calls the overloaded function. More...
 
QPixmap transformed (const QTransform &, Qt::TransformationMode mode=Qt::FastTransformation) const
 Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. More...
 
int width () const
 Returns the width of the pixmap. More...
 
 ~QPixmap ()
 Destroys the pixmap. More...
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
virtual HDC getDC () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
virtual void releaseDC (HDC hdc) const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Public Variables

QPixmapCache::Key key
 

Additional Inherited Members

- Public Types inherited from QPixmap
typedef QExplicitlySharedDataPointer< QPixmapDataDataPtr
 
enum  HBitmapFormat { NoAlpha, PremultipliedAlpha, Alpha }
 HBITMAP and QPixmap is performed. More...
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Static Public Functions inherited from QPixmap
static int defaultDepth ()
 Returns the default pixmap depth used by the application. More...
 
static QPixmap fromImage (const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Converts the given image to a pixmap using the specified flags to control the conversion. More...
 
static QPixmap fromImageReader (QImageReader *imageReader, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Create a QPixmap from an image read directly from an imageReader. More...
 
static QPixmap fromMacCGImageRef (CGImageRef image)
 Returns a QPixmap that is equivalent to the given image. More...
 
static QPixmap fromWinHBITMAP (HBITMAP hbitmap, HBitmapFormat format=NoAlpha)
 Win32 only: Returns a QPixmap that is equivalent to the given bitmap. More...
 
static QPixmap fromWinHICON (HICON hicon)
 
static QPixmap grabWidget (QWidget *widget, const QRect &rect)
 Creates a pixmap and paints the given widget, restricted by the given rectangle, in it. More...
 
static QPixmap grabWidget (QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
 
static QPixmap grabWindow (WId, int x=0, int y=0, int w=-1, int h=-1)
 Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height). More...
 
static QMatrix trueMatrix (const QMatrix &m, int w, int h)
 This convenience function loads the matrix m into a QTransform and calls the overloaded function with the QTransform and the width w and the height h. More...
 
static QTransform trueMatrix (const QTransform &m, int w, int h)
 Returns the actual matrix used for transforming a pixmap with the given width, height and matrix. More...
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Protected Functions inherited from QPixmap
int metric (PaintDeviceMetric) const
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 
- Protected Variables inherited from QPaintDevice
ushort painters
 

Detailed Description

Definition at line 79 of file qpixmapcache_p.h.

Constructors and Destructors

◆ QPixmapCacheEntry()

QPixmapCacheEntry::QPixmapCacheEntry ( const QPixmapCache::Key key,
const QPixmap pix 
)
inline

Definition at line 82 of file qpixmapcache_p.h.

82  : QPixmap(pix), key(key)
83  {
84  QPixmapData *pd = pixmapData();
85  if (pd && pd->classId() == QPixmapData::RasterClass) {
86  QRasterPixmapData *d = static_cast<QRasterPixmapData*>(pd);
87  if (!d->image.isNull() && d->image.d->paintEngine
88  && !d->image.d->paintEngine->isActive())
89  {
90  delete d->image.d->paintEngine;
91  d->image.d->paintEngine = 0;
92  }
93  }
94  }
double d
Definition: qnumeric_p.h:62
QPixmap()
Constructs a null pixmap.
Definition: qpixmap.cpp:174
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Definition: qimage.cpp:1542
QImageData * d
Definition: qimage.h:336
QPixmapCache::Key key
bool isActive() const
Returns true if the paint engine is actively drawing; otherwise returns false.
Definition: qpaintengine.h:154
QPaintEngine * paintEngine
Definition: qimage_p.h:110
ClassId classId() const
QPixmapData * pixmapData() const
Definition: qpixmap.cpp:2277

◆ ~QPixmapCacheEntry()

QPixmapCacheEntry::~QPixmapCacheEntry ( )

Definition at line 472 of file qpixmapcache.cpp.

473 {
474  pm_cache()->releaseKey(key);
475 }
QPixmapCache::Key key

Properties

◆ key

QPixmapCache::Key QPixmapCacheEntry::key

Definition at line 96 of file qpixmapcache_p.h.


The documentation for this class was generated from the following files: