diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-05-03 15:00:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-05-03 16:10:52 +0200 |
commit | f1f5a80cfeee145e4c0d080cb1e592e845e7ce83 (patch) | |
tree | 141d77c60e9ec83201a6017b4e7b91279da622f9 /src/gui/image/qicon.cpp | |
parent | 2ce57e22d0c8d68a98463bf7ea6a97c6bd2b7742 (diff) |
remove QApplication dependencies in gui/image
Diffstat (limited to 'src/gui/image/qicon.cpp')
-rw-r--r-- | src/gui/image/qicon.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index ffe7e3088e..76224fe56e 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -45,7 +45,6 @@ #include "qiconengineplugin.h" #include "private/qfactoryloader_p.h" #include "private/qiconloader_p.h" -#include "qapplication.h" #include "qstyleoption.h" #include "qpainter.h" #include "qfileinfo.h" @@ -263,37 +262,38 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St if (!actualSize.isNull() && (actualSize.width() > size.width() || actualSize.height() > size.height())) actualSize.scale(size, Qt::KeepAspectRatio); - QString key = QLatin1Literal("qt_") - % HexString<quint64>(pm.cacheKey()) - % HexString<uint>(pe->mode) - % HexString<quint64>(QApplication::palette().cacheKey()) - % HexString<uint>(actualSize.width()) - % HexString<uint>(actualSize.height()); - - if (mode == QIcon::Active) { - if (QPixmapCache::find(key % HexString<uint>(mode), pm)) - return pm; // horray - if (QPixmapCache::find(key % HexString<uint>(QIcon::Normal), pm)) { - QStyleOption opt(0); - opt.palette = QApplication::palette(); - QPixmap active = QApplication::style()->generatedIconPixmap(QIcon::Active, pm, &opt); - if (pm.cacheKey() == active.cacheKey()) - return pm; - } - } - - if (!QPixmapCache::find(key % HexString<uint>(mode), pm)) { + // #### Qt5 no idea what this really does, but we need to remove the QApp and style references +// QString key = QLatin1Literal("qt_") +// % HexString<quint64>(pm.cacheKey()) +// % HexString<uint>(pe->mode) +// % HexString<quint64>(QApplication::palette().cacheKey()) +// % HexString<uint>(actualSize.width()) +// % HexString<uint>(actualSize.height()); + +// if (mode == QIcon::Active) { +// if (QPixmapCache::find(key % HexString<uint>(mode), pm)) +// return pm; // horray +// if (QPixmapCache::find(key % HexString<uint>(QIcon::Normal), pm)) { +// QStyleOption opt(0); +// opt.palette = QApplication::palette(); +// QPixmap active = QApplication::style()->generatedIconPixmap(QIcon::Active, pm, &opt); +// if (pm.cacheKey() == active.cacheKey()) +// return pm; +// } +// } + +// if (!QPixmapCache::find(key % HexString<uint>(mode), pm)) { if (pm.size() != actualSize) pm = pm.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - if (pe->mode != mode && mode != QIcon::Normal) { - QStyleOption opt(0); - opt.palette = QApplication::palette(); - QPixmap generated = QApplication::style()->generatedIconPixmap(mode, pm, &opt); - if (!generated.isNull()) - pm = generated; - } - QPixmapCache::insert(key % HexString<uint>(mode), pm); - } +// if (pe->mode != mode && mode != QIcon::Normal) { +// QStyleOption opt(0); +// opt.palette = QApplication::palette(); +// QPixmap generated = QApplication::style()->generatedIconPixmap(mode, pm, &opt); +// if (!generated.isNull()) +// pm = generated; +// } +// QPixmapCache::insert(key % HexString<uint>(mode), pm); +// } return pm; } |