Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qstyle_p.h File Reference

(896c4fe4279f7dc761dcd59f7b0cde070c38b3cb)

#include "private/qobject_p.h"
#include <QtGui/qguiapplication.h>
#include <QtWidgets/qstyle.h>
+ Include dependency graph for qstyle_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QStylePrivate
 

Macros

#define BEGIN_STYLE_PIXMAPCACHE(a)
 
#define END_STYLE_PIXMAPCACHE
 

Functions

QPixmap styleCachePixmap (const QSize &size, qreal pixelRatio)
 

Macro Definition Documentation

◆ BEGIN_STYLE_PIXMAPCACHE

#define BEGIN_STYLE_PIXMAPCACHE ( a)
Value:
QRect rect = option->rect; \
QPixmap internalPixmapCache; \
const auto dpr = p->device()->devicePixelRatio(); \
const QString unique = QStyleHelper::uniqueName((a), option, option->rect.size(), dpr); \
int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
const bool doPixmapCache = (!option->rect.isEmpty()) \
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()); \
internalPixmapCache = styleCachePixmap(option->rect.size(), dpr); \
p = new QPainter(&internalPixmapCache); \
}
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
const QTransform & worldTransform() const
Returns the world transformation matrix.
const QTransform & deviceTransform() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
TransformationType type() const
Returns the transformation type of this matrix.
rect
[4]
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size, qreal dpr)
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat p
[1]
GLuint GLenum option
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
QPixmap styleCachePixmap(const QSize &size, qreal pixelRatio)
Definition qstyle_p.h:38
QPainter painter(this)
[7]

Definition at line 46 of file qstyle_p.h.

Referenced by QQC2::QStyleHelper::drawDial().

◆ END_STYLE_PIXMAPCACHE

#define END_STYLE_PIXMAPCACHE
Value:
if (doPixmapCache) { \
p->end(); \
delete p; \
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
QPixmapCache::insert(unique, internalPixmapCache); \
} \
}

Definition at line 66 of file qstyle_p.h.

Referenced by QQC2::QStyleHelper::drawDial().

Function Documentation

◆ styleCachePixmap()

QPixmap styleCachePixmap ( const QSize & size,
qreal pixelRatio )
inline

Definition at line 38 of file qstyle_p.h.

References Qt::transparent.

Referenced by QCommonStyle::drawPrimitive().

+ Here is the caller graph for this function: