Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qstyle_p.h File Reference
#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

QImage styleCacheImage (const QSize &size)
 
QPixmap styleCachePixmap (const QSize &size)
 

Macro Definition Documentation

◆ BEGIN_STYLE_PIXMAPCACHE

#define BEGIN_STYLE_PIXMAPCACHE (   a)
Value:
QRect rect = option->rect; \
QPixmap internalPixmapCache; \
QImage imageCache; \
QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
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()); \
imageCache = styleCacheImage(option->rect.size()); \
imageCache.fill(0); \
p = new QPainter(&imageCache); \
}
\inmodule QtGui
Definition qimage.h:37
void fill(uint pixel)
Fills the entire image with the given pixelValue.
Definition qimage.cpp:1738
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:127
TransformationType type() const
Returns the transformation type of this matrix.
rect
[4]
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat p
[1]
GLuint GLenum option
QImage styleCacheImage(const QSize &size)
Definition qstyle_p.h:42
QPainter painter(this)
[7]

Definition at line 58 of file qstyle_p.h.

◆ 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:1445

Definition at line 79 of file qstyle_p.h.

Function Documentation

◆ styleCacheImage()

QImage styleCacheImage ( const QSize size)
inline

Definition at line 42 of file qstyle_p.h.

References QImage::Format_ARGB32_Premultiplied, qApp, and QImage::setDevicePixelRatio().

+ Here is the call graph for this function:

◆ styleCachePixmap()

QPixmap styleCachePixmap ( const QSize size)
inline

Definition at line 50 of file qstyle_p.h.

References qApp, and QPixmap::setDevicePixelRatio().

+ Here is the call graph for this function: