summaryrefslogtreecommitdiff
path: root/src/plugins/iconengines
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-05-16 09:47:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-16 12:21:12 +0200
commit24aedcb90a6f274c6329ccfcd0ab83f7e1d0ec7d (patch)
tree8f6de7dd9cb4b80f77e174c98221a5414028b43c /src/plugins/iconengines
parent397f69ed52cb6a79d0e5868cef2764f0f657e7c7 (diff)
downloadqtsvg-24aedcb90a6f274c6329ccfcd0ab83f7e1d0ec7d.tar.gz
Remove dependency of the SVG icon engine plugin on QtWidgets.
Use the virtual QGuiApplicationPrivate::applyQIconStyleHelper() introduced by commit 6c06e14a49773ce5572935864ed6b9be219c6103 in qtbase to adapt the icon according to the style. Change-Id: I7c429f818c012c58118c64cc3b20a87fcb712877 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/plugins/iconengines')
-rw-r--r--src/plugins/iconengines/iconengines.pro2
-rw-r--r--src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp12
-rw-r--r--src/plugins/iconengines/svgiconengine/svgiconengine.pro2
3 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/iconengines/iconengines.pro b/src/plugins/iconengines/iconengines.pro
index e7d1871..21bb8a7 100644
--- a/src/plugins/iconengines/iconengines.pro
+++ b/src/plugins/iconengines/iconengines.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-qtHaveModule(widgets): SUBDIRS += svgiconengine
+SUBDIRS += svgiconengine
diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
index 1f47dfe..383881f 100644
--- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
+++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
@@ -46,12 +46,10 @@
#include "qpixmap.h"
#include "qsvgrenderer.h"
#include "qpixmapcache.h"
-#include "qstyle.h"
-#include "qapplication.h"
-#include "qstyleoption.h"
#include "qfileinfo.h"
#include <QAtomicInt>
#include "qdebug.h"
+#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -178,10 +176,8 @@ QPixmap QSvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode,
renderer.render(&p);
p.end();
pm = QPixmap::fromImage(img);
- if (qobject_cast<QApplication *>(QCoreApplication::instance())) {
- QStyleOption opt(0);
- opt.palette = QGuiApplication::palette();
- QPixmap generated = QApplication::style()->generatedIconPixmap(mode, pm, &opt);
+ if (qobject_cast<QGuiApplication *>(QCoreApplication::instance())) {
+ const QPixmap generated = QGuiApplicationPrivate::instance()->applyQIconStyleHelper(mode, pm);
if (!generated.isNull())
pm = generated;
}
diff --git a/src/plugins/iconengines/svgiconengine/svgiconengine.pro b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
index 2b27b3d..516142b 100644
--- a/src/plugins/iconengines/svgiconengine/svgiconengine.pro
+++ b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
@@ -9,4 +9,4 @@ HEADERS += qsvgiconengine.h
SOURCES += main.cpp \
qsvgiconengine.cpp
OTHER_FILES += qsvgiconengine.json
-QT += xml svg gui
+QT += svg core-private gui-private