summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2024-09-25 19:32:43 +0200
committerChristian Ehrlicher <[email protected]>2024-11-01 17:07:52 +0100
commit16ed137ef4dee63ee6f6c4af9ca96c4538b9f61c (patch)
tree27de25be8c63838614005abeed341b15d9ddf774
parent8945f7d6eb6c370ab5992d6250194f7b2c9df969 (diff)
QStyle: remove now unneeded macros for QPixmapCache
Remove BEGIN_STYLE_PIXMAPCACHE and END_STYLE_PIXMAPCACHE as they are no longer needed and replaced by QCachedPainter. Task-number: QTBUG-129680 Change-Id: I1a98b378c908c1369ca58a64e97b6aafd7897018 Reviewed-by: Axel Spoerl <[email protected]>
-rw-r--r--src/widgets/styles/qcommonstyle_p.h1
-rw-r--r--src/widgets/styles/qstyle_p.h30
2 files changed, 1 insertions, 30 deletions
diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h
index 2fa90a8949e..46f1d4e67a3 100644
--- a/src/widgets/styles/qcommonstyle_p.h
+++ b/src/widgets/styles/qcommonstyle_p.h
@@ -5,6 +5,7 @@
#define QCOMMONSTYLE_P_H
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtGui/private/qguiapplication_p.h>
#include "qhash.h"
#include "qcommonstyle.h"
#include "qstyle_p.h"
diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h
index 0412aca209b..f9e058d6df9 100644
--- a/src/widgets/styles/qstyle_p.h
+++ b/src/widgets/styles/qstyle_p.h
@@ -5,7 +5,6 @@
#define QSTYLE_P_H
#include "private/qobject_p.h"
-#include <QtGui/qguiapplication.h>
#include <QtWidgets/qstyle.h>
QT_BEGIN_NAMESPACE
@@ -43,35 +42,6 @@ inline QPixmap styleCachePixmap(const QSize &size, qreal pixelRatio)
return cachePixmap;
}
-#define BEGIN_STYLE_PIXMAPCACHE(a) \
- QRect rect = option->rect; \
- QPixmap internalPixmapCache; \
- QPainter *p = painter; \
- const auto dpr = QStyleHelper::getDpr(p); \
- 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()) \
- && ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
- 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); \
- }
-
-
-
-#define END_STYLE_PIXMAPCACHE \
- if (doPixmapCache) { \
- p->end(); \
- delete p; \
- painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
- QPixmapCache::insert(unique, internalPixmapCache); \
- } \
- }
-
// small helper to read out the pixmap to paint from QPixmapCache or re-draw
// it and put it into the QPixmapCache for later usage
class Q_WIDGETS_EXPORT QCachedPainter