diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-19 23:10:18 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-19 23:10:18 +0200 |
commit | b231d9f41903f8514a2d91844f4515055307af3a (patch) | |
tree | 81d0f895ecb58b7c5de676ca09211c179862750d /src/plugins | |
parent | 612c3041475550837dee7149b9f5e9e4f55c17a0 (diff) | |
parent | 0eeaceca600ce63711387d4e3375c7a50239802d (diff) | |
download | qtsvg-b231d9f41903f8514a2d91844f4515055307af3a.tar.gz |
Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-rc1
Conflicts:
.qmake.conf
Change-Id: I55408b98072be007247bca4fa61f1a62ce32e7ca
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp index 4fd4c3a..713f2ad 100644 --- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp +++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp @@ -122,10 +122,13 @@ QSize QSvgIconEngine::actualSize(const QSize &size, QIcon::Mode mode, void QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state) { QByteArray buf; + const QIcon::State oppositeState = state == QIcon::Off ? QIcon::On : QIcon::Off; if (svgBuffers) { buf = svgBuffers->value(hashKey(mode, state)); if (buf.isEmpty()) - buf = svgBuffers->value(hashKey(QIcon::Normal, QIcon::Off)); + buf = svgBuffers->value(hashKey(QIcon::Normal, state)); + if (buf.isEmpty()) + buf = svgBuffers->value(hashKey(QIcon::Normal, oppositeState)); } if (!buf.isEmpty()) { #ifndef QT_NO_COMPRESS @@ -135,7 +138,9 @@ void QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer *renderer, QIco } else { QString svgFile = svgFiles.value(hashKey(mode, state)); if (svgFile.isEmpty()) - svgFile = svgFiles.value(hashKey(QIcon::Normal, QIcon::Off)); + svgFile = svgFiles.value(hashKey(QIcon::Normal, state)); + if (svgFile.isEmpty()) + svgFile = svgFiles.value(hashKey(QIcon::Normal, oppositeState)); if (!svgFile.isEmpty()) renderer->load(svgFile); } |