7#include "private/qobject_p.h"
8#include <QtGui/qguiapplication.h>
9#include <QtWidgets/qstyle.h>
44 const qreal pixelRatio =
qApp->devicePixelRatio();
52 const qreal pixelRatio =
qApp->devicePixelRatio();
58#define BEGIN_STYLE_PIXMAPCACHE(a) \
59 QRect rect = option->rect; \
60 QPixmap internalPixmapCache; \
62 QPainter *p = painter; \
63 QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
64 int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
65 bool doPixmapCache = (!option->rect.isEmpty()) \
66 && ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
67 if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
68 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
70 if (doPixmapCache) { \
71 rect.setRect(0, 0, option->rect.width(), option->rect.height()); \
72 imageCache = styleCacheImage(option->rect.size()); \
74 p = new QPainter(&imageCache); \
79#define END_STYLE_PIXMAPCACHE \
80 if (doPixmapCache) { \
83 internalPixmapCache = QPixmap::fromImage(imageCache); \
84 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
85 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.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static bool useFullScreenForPopup()
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
QImage styleCacheImage(const QSize &size)
QPixmap styleCachePixmap(const QSize &size)