diff options
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qicon.cpp | 13 | ||||
-rw-r--r-- | src/gui/image/qiconloader.cpp | 7 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index a4ea6af..e23677f 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -888,10 +888,9 @@ void QIcon::setThemeSearchPaths(const QStringList &paths) On X11, the search path will use the XDG_DATA_DIRS environment variable if available. - On Windows the search path defaults to [Application Directory]/icons - - On Mac the default search path will search in the - [Contents/Resources/icons] part of the application bundle. + By default all platforms will have the resource directory + ":\icons" as their fallback. You can use "rcc -project" + to generate a resource file from your icon theme. \sa setThemeSearchPaths(), fromTheme(), setThemeName() */ @@ -906,7 +905,7 @@ QStringList QIcon::themeSearchPaths() Sets the current icon theme to \a name. The \a name should correspond to a directory name in the - current themeSearchPath() containing an index.theme + themeSearchPath() containing an index.theme file describing it's contents. \sa themeSearchPaths(), themeName() @@ -939,10 +938,6 @@ QString QIcon::themeName() icon theme. If no such icon is found in the current theme \a fallback is return instead. - To use an icon theme on Windows or Mac, you will need to - bundle a compliant theme with your application and make sure - it is located in your themeSarchPaths. - The lastest version of the freedesktop icon specification and naming spesification can be obtained here: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 279703c..cb1cc61 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -187,14 +187,17 @@ QStringList QIconLoader::themeSearchPaths() const QDir homeDir(QDir::homePath() + QLatin1String("/.icons")); if (homeDir.exists()) m_iconDirs.prepend(homeDir.path()); - -#elif defined(Q_WS_WIN) +#endif + +#if defined(Q_WS_WIN) m_iconDirs.append(qApp->applicationDirPath() + QLatin1String("/icons")); #elif defined(Q_WS_MAC) m_iconDirs.append(qApp->applicationDirPath() + QLatin1String("/../Resources/icons")); #endif + // Allways add resource directory as search path + m_iconDirs.append(QLatin1String(":/icons")); } return m_iconDirs; } |