summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylehelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstylehelper.cpp')
-rw-r--r--src/widgets/styles/qstylehelper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index f79e83be61..1084761d30 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -25,8 +25,18 @@ Q_GUI_EXPORT int qt_defaultDpiX();
namespace QStyleHelper {
+static inline bool usePixmapCache(const QStyleOption *opt)
+{
+ if (QWidget *widget = qobject_cast<QWidget *>(opt->styleObject))
+ return !widget->testAttribute(Qt::WA_StyleSheetTarget);
+ return true;
+}
+
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
{
+ if (!usePixmapCache(option))
+ return {};
+
const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);
QString tmp = key % HexString<uint>(option->state)
% HexString<uint>(option->direction)