From f45afd71551a6cd1553952ea003e9356651809b5 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 21 Sep 2012 19:53:28 +0200 Subject: Introduce new style Fusion This is a new non-native style for Qt. It is intended as a replacement for the now aging Plastique and Cleanlooks styles. Change-Id: I30c0518a69e4e3b8b2b05ee7d84c3a5a1f307578 Reviewed-by: Jens Bache-Wiig Reviewed-by: J-P Nurmi --- src/widgets/styles/qstyle_p.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/widgets/styles/qstyle_p.h') diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h index 66cd7eed10..85e8e54b16 100644 --- a/src/widgets/styles/qstyle_p.h +++ b/src/widgets/styles/qstyle_p.h @@ -72,6 +72,15 @@ public: QStyle *proxyStyle; }; +inline QImage styleCacheImage(const QSize &size) +{ + return QImage(size, QImage::Format_ARGB32_Premultiplied); +} + +inline QPixmap styleCachePixmap(const QSize &size) +{ + return QPixmap(size); +} #define BEGIN_STYLE_PIXMAPCACHE(a) \ QRect rect = option->rect; \ @@ -80,13 +89,14 @@ public: QPainter *p = painter; \ QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \ int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \ - bool doPixmapCache = txType <= QTransform::TxTranslate; \ + bool doPixmapCache = (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()); \ - imageCache = QImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); \ + imageCache = styleCacheImage(option->rect.size()); \ imageCache.fill(0); \ p = new QPainter(&imageCache); \ } -- cgit v1.2.3