7#include "private/qobject_p.h"
8#include <QtGui/qguiapplication.h>
9#include <QtWidgets/qstyle.h>
41 cachePixmap.setDevicePixelRatio(pixelRatio);
46#define BEGIN_STYLE_PIXMAPCACHE(a) \
47 QRect rect = option->rect; \
48 QPixmap internalPixmapCache; \
49 QPainter *p = painter; \
50 const auto dpr = p->device()->devicePixelRatio(); \
51 const QString unique = QStyleHelper::uniqueName((a), option, option->rect.size(), dpr); \
52 int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
53 const bool doPixmapCache = (!option->rect.isEmpty()) \
54 && ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
55 if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
56 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
58 if (doPixmapCache) { \
59 rect.setRect(0, 0, option->rect.width(), option->rect.height()); \
60 internalPixmapCache = styleCachePixmap(option->rect.size(), dpr); \
61 p = new QPainter(&internalPixmapCache); \
66#define END_STYLE_PIXMAPCACHE \
67 if (doPixmapCache) { \
70 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
71 QPixmapCache::insert(unique, internalPixmapCache); \
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\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]
QPixmap styleCachePixmap(const QSize &size, qreal pixelRatio)