Qt 4.8
Classes | Macros
qstyle_p.h File Reference
#include "private/qobject_p.h"
#include <QtGui/qstyle.h>

Go to the source code of this file.

Classes

class  QStylePrivate
 

Macros

#define BEGIN_STYLE_PIXMAPCACHE(a)
 
#define END_STYLE_PIXMAPCACHE
 

Macro Definition Documentation

◆ BEGIN_STYLE_PIXMAPCACHE

#define BEGIN_STYLE_PIXMAPCACHE (   a)
Value:
QRect rect = option->rect; \
QPixmap internalPixmapCache; \
QImage imageCache; \
QPainter *p = painter; \
QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
bool doPixmapCache = txType <= QTransform::TxTranslate; \
if (doPixmapCache && QPixmapCache::find(unique, internalPixmapCache)) { \
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
} else { \
if (doPixmapCache) { \
rect.setRect(0, 0, option->rect.width(), option->rect.height()); \
imageCache = QImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); \
imageCache.fill(0); \
p = new QPainter(&imageCache); \
}
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
void fill(uint pixel)
Fills the entire image with the given pixelValue.
Definition: qimage.cpp:2032
long ASN1_INTEGER_get ASN1_INTEGER * a
static QPixmap * find(const QString &key)
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

Definition at line 76 of file qstyle_p.h.

Referenced by QPlastiqueStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QStyleHelper::drawDial(), QPlastiqueStyle::drawPrimitive(), and QCleanlooksStyle::drawPrimitive().

◆ END_STYLE_PIXMAPCACHE

#define END_STYLE_PIXMAPCACHE
Value:
if (doPixmapCache) { \
p->end(); \
delete p; \
internalPixmapCache = QPixmap::fromImage(imageCache); \
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
QPixmapCache::insert(unique, internalPixmapCache); \
} \
}
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.
Definition: qpixmap.cpp:2197
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.

Definition at line 96 of file qstyle_p.h.

Referenced by QPlastiqueStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QStyleHelper::drawDial(), QPlastiqueStyle::drawPrimitive(), and QCleanlooksStyle::drawPrimitive().