diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp index 902e59d..6d84df1 100644 --- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp +++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp @@ -180,11 +180,13 @@ QPixmap QSvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode, renderer.render(&p); p.end(); pm = QPixmap::fromImage(img); - QStyleOption opt(0); - opt.palette = QApplication::palette(); - QPixmap generated = QApplication::style()->generatedIconPixmap(mode, pm, &opt); - if (!generated.isNull()) - pm = generated; + if (qobject_cast<QApplication *>(QCoreApplication::instance())) { + QStyleOption opt(0); + opt.palette = QGuiApplication::palette(); + QPixmap generated = QApplication::style()->generatedIconPixmap(mode, pm, &opt); + if (!generated.isNull()) + pm = generated; + } if (!pm.isNull()) QPixmapCache::insert(pmckey, pm); |