summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qiconloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Handle device pixel ratio in QIconLoaderEngine::paint()Alexander Volkov2019-03-201-1/+4
| | | | | | | | | QIcon::paint() paints blurry icons on HighDPI screens. In particular, it is called by QCommonStyle to paint icons for CE_ItemViewItem's. Change-Id: Iffe6bd01a8756e617656195ef63fe13c968e0832 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-2/+4
|\ | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| * Modernize the "settings" featureLiang Qi2018-11-151-2/+4
| | | | | | | | | | | | Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Allow setting the QIcon fallback themeAlbert Astals Cid2018-08-201-5/+15
|/ | | | | | | | | | | | | | | This allows apps that know their icons are in a given icon theme to set that theme as fallback, so in case the user theme does not include them, the icons can still be found. This solves the problem of missing icons that often happens when running KDE applications on a GNOME desktop. Change-Id: I4e5543d598012352a29ff79dab0357506d986b6d Reviewed-by: Dominik Haumann <dhaumann@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Introduce QIcon::fallbackSearchPaths()Alexander Volkov2018-01-151-5/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... that will be used if an icon can't be found in the current theme. The Icon Theme Specification https://standards.freedesktop.org/icon-theme-spec/latest/ar01s05.html states that unthemed icons must be searched in the base directories, i.e. /usr/share/icons, ... But in practice unthemed icons are installed into /usr/share/pixmaps and this dir is not used as a base dir for icon themes. So it's better to explicitly specify fallback dirs to avoid needless access to the filesystem. Also some KDE application install their own unthemed icons (into /usr/share/<appname>/pics), that can't be found by QIconLoader. With this change it would be possible for them to specify dirs with unthemed icons and thus be displayed correctly in non-KDE environments. [ChangeLog][QtGui][QIcon] Added fallbackSearchPaths() that will be used to find icons missing in the current icon theme. Change-Id: I0dc55ba958b29356a3b0a2123d6b8faa24d4c91e Task-number: QTBUG-33123 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-071-1/+4
|\ | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * QIconLoaderEngine: Fix actualSize() for no-entryPalo Kisa2017-05-031-1/+4
| | | | | | | | | | | | | | | | | | Return an empty size if no suitable entry found to avoid mismatch with the returned pixmap()'s size (the QIconEngine::actualSize() returns the originally requested size). Change-Id: Ia278719a54392b62c5f9fc0529476baba5cd7df0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Export QIconLoaderEngine::entryForSize() for QQuickIconImageJ-P Nurmi2017-02-231-7/+7
|/ | | | | | | | | Let QQuickIconImage re-use entryForSize() so it can easily choose the appropriate icon without re-inventing the wheel. Change-Id: I88c7e058113b2fb5a864578d8c66f99f61b4eac3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Implement support for Scale directory key according to Icon Theme specMitch Curtis2017-02-011-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | Qt already supports high DPI icons using the “@nx” approach, where the device pixel ratio that the image was designed for is in the file name. However, our implementation of the freedekstop.org Icon Theme specification did not support the Scale directory key: https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout This meant that users creating icons via QIcon::fromTheme() did not get high DPI support. This patch fixes that. [ChangeLog][QtGui][QIcon] Implemented support for Scale directory key according to Icon Theme Spec. Icons created via QIcon::fromTheme() now have high DPI support by specifying the Scale in the appropriate entry of the relevant index.theme file. Task-number: QTBUG-49820 Change-Id: If442fbc551034166d88defe607109de1c6ca1d28 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-151-2/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | * Remove unused variable in QIconLoader::findIconHelper()Alexander Volkov2016-11-121-2/+0
| | | | | | | | | | | | | | | Change-Id: Idac0b24631187063445ea5acfd078b2479359d52 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Improve use of QHash to minimize double hashingAllan Sandfeld Jensen2016-11-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Avoid looking up by key twice in a row in various locations, but instead using iterators and index lookup. Change-Id: I61a079115199ab9c041ad3a26d36b45ee3f775e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Replace QLatin1Literal with QLatin1StringAnton Kudryavtsev2016-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLatin1Literal is just alias of QLatin1String for Qt4 compatibility. So it's style cleanup patch. Change-Id: Ia3b3e5dc3169f13a1ef819d69be576b8a8bfb258 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QIconCacheGtkReader: use QStringRef moreAnton Kudryavtsev2016-08-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | lookup() method now takes QStringRef arg. Reduce allocations. Change-Id: I556d01be5c5f268672121ab4c67c652cb6cfe090 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Remove last uses of Java-style (non-mutable) iterators from QtBaseMarc Mutz2016-08-131-4/+2
| | | | | | | | | | | | | | | Change-Id: I7531ffd4f2d5b2193bb6231c743ff0a074618b99 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-201-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And blacklisted a few tests in tst_QUdpSocket. Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtNative.java src/corelib/global/qglobal.cpp src/corelib/global/qsystemdetection.h src/corelib/io/qfileselector.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp tests/auto/network/socket/qudpsocket/BLACKLIST Task-number: QTBUG-54205 Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
| | * QIconLoader: Fix typo in directoryMatchesSize()Palo Kisa2016-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QIconDirInfo::Scalable directories condition for directoryMatchesSize was mistyped. In particular only the minSize was considered which could lead to false positive checks. [ChangeLog][QtGui][QIconLoaderEngine] Fixed theme lookup for scalable entries Change-Id: Ic7e06cc0a2e4be69e6633847cef8c2c5686378ea Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * | Gui: use const (and const APIs) moreAnton Kudryavtsev2016-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Optimize QIconLoader::findIconHelper()John Lindgren2016-05-241-10/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | Profiling QIconLoader::findIconHelper() shows that a significant portion of CPU time is being spent in QDir::exists(), which creates a new QFileInfo object for the sole purpose of determining whether the passed-in file path is relative or absolute, and then calls QFile::exists(). In this context, we can just as easily generate the absolute path and call QFile::exists() directly, avoiding the creation of extra QDir and QFileInfo objects. Change-Id: Ib0b4568b6c16d423eb6c1b15158e44ff141e6175 Task-number: QTBUG-46767 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix some qdoc-warnings in 5.7.Friedemann Kleint2016-04-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/global/qnamespace.qdoc:101: warning: Undocumented enum item 'AA_SynthesizeMouseForUnhandledTabletEvents' in Qt::ApplicationAttribute qtbase/src/corelib/global/qnamespace.qdoc:2554: warning: Undocumented enum item 'ImAnchorRectangle' in Qt::InputMethodQuery qtbase/src/corelib/statemachine/qsignaltransition.cpp:154: warning: Can't link to 'Q_COMPILER_DELEGATING_CONSTRUCTORS' qtbase/src/gui/image/qiconloader.cpp:160: warning: Cannot find 'QIconCacheGtkReader' specified with '\class' in any header file qtbase/src/gui/painting/qpaintengine_raster.cpp:1382: warning: No documentation for 'QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)' qtbase/src/testlib/qtest.h:176: warning: No documentation for 'QTest::toString(const QHostAddress &addr)' qtbase/src/testlib/qtest_gui.h:77: warning: No documentation for 'QTest::toString(const QColor &color)' Change-Id: If9ac0807accf2530ec7fc2ca7db71a110f9f79bb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | QtGui: eradicate Q_FOREACH loops [already const]Marc Mutz2016-02-111-2/+2
| | | | | | | | | | | | | | | | | | (or trivially marked const) ... by replacing them with C++11 range-for loops. Change-Id: I3cce92b9d77a3ff96fad877d1d989145e530646f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Drop most "#ifndef QT_NO_LIBRARY"Ulf Hermann2016-02-081-4/+0
| | | | | | | | | | | | | | | | | | As we can load plugins without QLibrary now, we don't have to #ifdef out the code that does so anymore. Change-Id: I1dc20216830a882dbd5a1b431183407e6b19c837 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QIconLoader: Use the GTK+ icon cachesOlivier Goffart2015-09-131-2/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading icons is quite slow because we need to stat many files in many directories. That's why gtk adds a cache in the icon theme directory so it avoids stating lots of files. The cache file can be generated with gtk-update-icon-cache utility on a theme directory. If the cache is not present, corrupted, or outdated, the normal slow lookup is still run. [ChangeLog][QtGui][QIcon] fromTheme gained the ability to use the GTK icon cache to speed up lookups. Change-Id: I3ab8a9910be67a34034556023be61a86789a7893 Reviewed-by: David Faure <david.faure@kdab.com>
* | QIcon: add a hook in the engine so a non null QIconEngine can still be a ↵Olivier Goffart2015-09-111-0/+5
|/ | | | | | | | | | | | | | null icon Implement it in the QIconLoader We have to change detach() because some code does: icon = QIcon::fromTheme("foobar"); if (icon.isNull()) icon.addPixmap(...); so addPixmap and addFile have to work on a null QIcon by resetting the iconEngine. Change-Id: I07719bef93930cf4692384a8c64e21a97dcce25c Reviewed-by: David Faure <david.faure@kdab.com>
* Do not support static QIcon instancesFrederik Gladhorn2015-07-091-3/+0
| | | | | | | | | | | | There was an attempt to allow static instances of QIcon in 7727a4355876607a1a022ff54e2570dae883f79c (Qt 4). This patch does only solve some of the corner cases and broke with aa5f70c00a88edcddd26e8fea767a40e8c5c31b8. Since the "breakage" has been there for two years, let's officially declare it unsupported instead of trying to work around the issue. Change-Id: I61e12fd03953763ee2e70eae58bcaecabdcb85b8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Remove Q_DEAD_CODE_FROM_QT4_MAC sectionsMorten Johan Sørvig2015-07-081-7/+0
| | | | | Change-Id: I483446c9eac8aa617b94e54f1e61f77a4eba7683 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Remove <qhash.h> where it's not usedMarc Mutz2015-04-201-1/+0
| | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-2/+2
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fixed icons lookup in QIcon::fromThemeRuslan Nigmatullin2015-02-021-49/+75
| | | | | | | | | | | | | | | | | | | | This commit fixes incorrect logic of icons' lookup if there are fallbacks or more than one theme's directory. According to Icon Theme Specification, Directory Layout section, theme can be spread across several base directories by having subdirectories of the same name. This makes possible to extend system themes by application-specific icons without making of collisions with other applications. According to Icon Naming Specification, Icon Naming Guidelines section, icon name may contain dashes to separate levels of specificity in icon names. This makes possible to set in application very specific icon which may be not in every theme. So it can fallback to less specific one. Change-Id: Iafc813902a3646be56e8f1d3a2fdbf8fd32ac542 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Avoid adding empty parent icon themeWeitian Leung2014-10-221-0/+1
| | | | | | | | "Icon Theme/Inherits" may assign an empty value, e.g. Flattr icon theme Change-Id: I90713b3eb67e39d6a49a49d1f5b3d7a75a8f30f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Use QPlatformTheme::SystemIconFallbackThemeName in static QString ↵Albert Astals Cid2014-09-031-1/+1
| | | | | | | | | fallbackTheme() Instead of QPlatformTheme::SystemIconThemeName Change-Id: Id318944730cd1b8014380a972eb28fd8aab1f382 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QIconLoader: enable an easy case of transactional processingMarc Mutz2014-09-021-3/+4
| | | | | | | | | It's easy to do the work on the side and then commit. This is strongly exception safe, but in Qt, we don't care. But transactional code, when this easy to achieve, is also clearer. Change-Id: I30f1badec7745d62a09af4eede234cb312b373aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QIconLoader: replace an inefficient QList with a QVectorMarc Mutz2014-08-231-1/+1
| | | | | | | | | | QIconDirInfo is larger than a pointer, so holding it in a QList is horribly inefficient. Fix by holding it in a QVector instead. Change-Id: I6551d2d2941447e600a33c3d68edf46db002d96c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: replace while(!empty()) delete takeLast() with qDeleteAll()Marc Mutz2014-08-231-6/+2
| | | | | | | | | | There's no calling back into QIconLoaderEngine from the QIconLoaderEngineEntry dtors, so don't bother slicing off one element by one from the container as they are deleted, the more so as m_entires is either move-assigned or deleted right after these loops. Change-Id: Ic9ffa442ef0b0c59e19eb91d164183ea5c3bab67 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the time (II)Marc Mutz2014-08-231-2/+4
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I688244f37c555365566cd1a59dc601974316a2e6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the timeMarc Mutz2014-08-231-1/+3
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I60cd1754f8be123c62e3b47f6f721f42a69fe3c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove another unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I2b11944d1964878ff5f6f666f33a97ea842ffea7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove an unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I4f1fee2da9358f63c4d3c9e46b8d69b4a1b280c7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Do not overwrite basePixmap of QIconLoader PixmapEntryAlbert Astals Cid2014-01-221-3/+4
| | | | | | Change-Id: I4799af1d9151ba4b0952369e9620d2fab2b002d9 Reviewed-by: David Sansome <me@davidsansome.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-04-291-4/+5
|\ | | | | | | Change-Id: I2a54058b64ac69c78b4120fdaf09b96e025a4c6c
| * Fixed crashes relating to SVG icons.Samuel Rødal2013-04-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a second QFactoryLoader for the same plugins seems to trigger an unload of the plugins loaded by the first factory loader. The QIconEngine created by the SVG icon plugin thus gets an invalid virtual table pointer, which causes a crash when attempting to call any virtual function in the QIconEngine (pixmap(), the virtual destructor, etc). Reusing a single QFactoryLoader instead fixes the crash. Task-number: QTBUG-30496 Change-Id: I80c5fa8b52ab9b0db68499f8c37fad14a1ac4f3c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Make sure QIconLoader is always initializedKevin Ottens2013-04-221-7/+5
|/ | | | | | | | | | | | | | | | | It is necessary to properly initialize the icon loader in all case. Otherwise some calls might give wrong results if a platform theme plugin is involved. For instance, we might miss the actual theme name reported by the platform theme, eg it's what happen with QStyle::standardPixmap if no one created a QIcon before its first call. Also clean up the accesses to the global static and have only QIconLoader::instance() use it. All other call go through the static method. This way only instance() needs to call ensureInitialized(), definitely safer and looks cleaner to me. Change-Id: Id3ea6816edd5a65586004f69464960abc3602cf8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Scale icons returned by QIcon::fromTheme.David Sansome2012-10-101-2/+8
| | | | | | | | | | | | | | | | | The icon engine behind icons that are loaded from QIcon::fromTheme does not scale any pixmaps that it returns. When using an icon theme with an incomplete set of icons (for example, only a "128x128" folder), QIcon::pixmap will always return 128x128 pixmaps even if you ask for one of size 22x22. This is contrary to the QIcon::pixmap documentation that says "The pixmap might be smaller than requested, but never larger." This patch uses the same code that is in the main QIcon class in the PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big. Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>