From a36cf93e8e140a37a90dfe07dd11f0693568ff34 Mon Sep 17 00:00:00 2001 From: Sergey Kiselev Date: Mon, 16 Jun 2025 11:11:04 +0500 Subject: [PATCH] x11-themes/qt6gtk2: Quick and dirty fix to build port with qt >=6.9 --- x11-themes/qt6gtk2/Makefile | 1 + .../patch-src_qt6gtk2-style_qstylehelper__p.h | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 x11-themes/qt6gtk2/files/patch-src_qt6gtk2-style_qstylehelper__p.h diff --git a/x11-themes/qt6gtk2/Makefile b/x11-themes/qt6gtk2/Makefile index e5105a4..82fc69e 100644 --- a/x11-themes/qt6gtk2/Makefile +++ b/x11-themes/qt6gtk2/Makefile @@ -1,5 +1,6 @@ PORTNAME= qt6gtk2 PORTVERSION= 0.3 +PORTREVISION= 1 CATEGORIES= x11-themes MAINTAINER= root@dc365.ru diff --git a/x11-themes/qt6gtk2/files/patch-src_qt6gtk2-style_qstylehelper__p.h b/x11-themes/qt6gtk2/files/patch-src_qt6gtk2-style_qstylehelper__p.h new file mode 100644 index 0000000..485c7a2 --- /dev/null +++ b/x11-themes/qt6gtk2/files/patch-src_qt6gtk2-style_qstylehelper__p.h @@ -0,0 +1,40 @@ +--- src/qt6gtk2-style/qstylehelper_p.h.orig 2025-06-11 06:41:16 UTC ++++ src/qt6gtk2-style/qstylehelper_p.h +@@ -43,6 +43,37 @@ + + QT_BEGIN_NAMESPACE + ++#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) ++#define BEGIN_STYLE_PIXMAPCACHE(a) \ ++ QRect rect = option->rect; \ ++ QPixmap internalPixmapCache; \ ++ QPainter *p = painter; \ ++ 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()) \ ++ && ((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); \ ++ } \ ++ } ++#endif ++ + class QPainter; + class QPixmap; + class QStyleOptionSlider;