9#include <QtCore/private/qobject_p.h>
10#include <QtGui/qguiapplication.h>
41 const qreal pixelRatio =
qApp->devicePixelRatio();
49 const qreal pixelRatio =
qApp->devicePixelRatio();
55#define BEGIN_STYLE_PIXMAPCACHE(a) \
56 QRect rect = option->rect; \
57 QPixmap internalPixmapCache; \
59 QPainter *p = painter; \
60 QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
61 int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
62 bool doPixmapCache = (!option->rect.isEmpty()) \
63 && ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
64 if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
65 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
67 if (doPixmapCache) { \
68 rect.setRect(0, 0, option->rect.width(), option->rect.height()); \
69 imageCache = styleCacheImage(option->rect.size()); \
71 p = new QPainter(&imageCache); \
74#define END_STYLE_PIXMAPCACHE \
75 if (doPixmapCache) { \
78 internalPixmapCache = QPixmap::fromImage(imageCache); \
79 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
80 QPixmapCache::insert(unique, internalPixmapCache); \
@ Format_ARGB32_Premultiplied
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the pixmap.
static bool useFullScreenForPopup()
QPixmap styleCachePixmap(const QSize &size)
QImage styleCacheImage(const QSize &size)
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]