Changeset 846 for trunk/src/gui/image/qicon.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/image/qicon.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 67 67 #endif 68 68 69 #include "private/qstylehelper_p.h" 70 69 71 #ifndef QT_NO_ICON 70 72 QT_BEGIN_NAMESPACE … … 262 264 actualSize.scale(size, Qt::KeepAspectRatio); 263 265 264 QString key = QLatin1String("$qt_icon_") 265 + QString::number(pm.cacheKey()) 266 + QString::number(pe->mode) 267 + QString::number(QApplication::palette().cacheKey()) 268 + QLatin1Char('_') 269 + QString::number(actualSize.width()) 270 + QLatin1Char('_') 271 + QString::number(actualSize.height()) 272 + QLatin1Char('_'); 273 266 QString key = QLatin1Literal("qt_") 267 % HexString<quint64>(pm.cacheKey()) 268 % HexString<uint>(pe->mode) 269 % HexString<quint64>(QApplication::palette().cacheKey()) 270 % HexString<uint>(actualSize.width()) 271 % HexString<uint>(actualSize.height()); 274 272 275 273 if (mode == QIcon::Active) { 276 if (QPixmapCache::find(key + QString::number(mode), pm))274 if (QPixmapCache::find(key % HexString<uint>(mode), pm)) 277 275 return pm; // horray 278 if (QPixmapCache::find(key + QString::number(QIcon::Normal), pm)) {276 if (QPixmapCache::find(key % HexString<uint>(QIcon::Normal), pm)) { 279 277 QStyleOption opt(0); 280 278 opt.palette = QApplication::palette(); … … 285 283 } 286 284 287 if (!QPixmapCache::find(key + QString::number(mode), pm)) {285 if (!QPixmapCache::find(key % HexString<uint>(mode), pm)) { 288 286 if (pm.size() != actualSize) 289 287 pm = pm.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); … … 295 293 pm = generated; 296 294 } 297 QPixmapCache::insert(key + QString::number(mode), pm);295 QPixmapCache::insert(key % HexString<uint>(mode), pm); 298 296 } 299 297 return pm; … … 442 440 } 443 441 444 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)442 #ifndef QT_NO_LIBRARY 445 443 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, 446 444 (QIconEngineFactoryInterface_iid, QLatin1String("/iconengines"), Qt::CaseInsensitive)) … … 880 878 881 879 /*! 880 \since 4.7 881 882 Returns the name used to create the icon, if available. 883 884 Depending on the way the icon was created, it may have an associated 885 name. This is the case for icons created with fromTheme() or icons 886 using a QIconEngine which supports the QIconEngineV2::IconNameHook. 887 888 \sa fromTheme(), QIconEngine 889 */ 890 QString QIcon::name() const 891 { 892 if (!d || !d->engine || d->engine_version < 2) 893 return QString(); 894 QIconEngineV2 *engine = static_cast<QIconEngineV2*>(d->engine); 895 return engine->iconName(); 896 } 897 898 /*! 882 899 \since 4.6 883 900
Note:
See TracChangeset
for help on using the changeset viewer.