Skip to content

Commit

Permalink
Doc: Fix QIcon documentation
Browse files Browse the repository at this point in the history
* Move \externalpage topics to external-resources.qdoc, as that command
  cannot be embedded in other topics.

* Fix references to non-existent function fallbackIconTheme().

Pick-to: 6.6
Change-Id: I5d08206c53aea9c2d4c6fddf5d04df187b01ef53
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
toreinio committed Oct 2, 2023
1 parent 8606f33 commit b5169b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
11 changes: 10 additions & 1 deletion src/gui/doc/src/external-resources.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,23 @@

/*!
\externalpage https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
\title Icon Theme Specification
\title Freedesktop Icon Theme Specification
*/

/*!
\externalpage https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
\title Freedesktop Icon Naming Specification
*/
/*!
\externalpage https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout
\title Icon Theme Specification - Directory Layout
*/

/*!
\externalpage https://freedesktop.org/
\title Freedesktop
*/

/*!
\externalpage https://www.khronos.org/vulkan/
\title Vulkan
Expand Down
27 changes: 10 additions & 17 deletions src/gui/image/qicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,9 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
icons: via \l addFile() and \l fromTheme().
\l addFile() is useful if you have your own custom directory structure and do
not need to use the \l {Icon Theme Specification}{freedesktop.org Icon Theme
Specification}. Icons created via this approach use Qt's \l {High Resolution
Versions of Images}{"@nx" high DPI syntax}.
not need to use the \l {Freedesktop Icon Theme Specification}. Icons
created via this approach use Qt's \l {High Resolution Versions of Images}
{"@nx" high DPI syntax}.
Using \l fromTheme() is necessary if you plan on following the Icon Theme
Specification. To make QIcon use the high DPI version of an image, add an
Expand Down Expand Up @@ -1200,10 +1200,8 @@ void QIcon::setFallbackSearchPaths(const QStringList &paths)
correspond to a directory name in the themeSearchPath()
containing an \c index.theme file describing its contents.
\externalpage http:https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
\title Freedesktop Icon Theme Specification
\sa themeSearchPaths(), themeName()
\sa themeSearchPaths(), themeName(),
{Freedesktop Icon Theme Specification}
*/
void QIcon::setThemeName(const QString &name)
{
Expand All @@ -1222,9 +1220,6 @@ void QIcon::setThemeName(const QString &name)
\l{Freedesktop} based systems at the moment, and the
icon theme depends on your desktop settings.
\externalpage https://www.freedesktop.org/
\title Freedesktop
\sa setThemeName(), themeSearchPaths(), fromTheme(),
hasThemeIcon()
*/
Expand Down Expand Up @@ -1282,7 +1277,7 @@ void QIcon::setFallbackThemeName(const QString &name)
\l{themeName()}{current icon theme}.
If the current theme does not provide an icon for \a name,
the \l{fallbackIconTheme()}{fallback icon theme} is consulted,
the \l{fallbackThemeName()}{fallback icon theme} is consulted,
before falling back to looking up standalone icon files in the
\l{QIcon::fallbackSearchPaths()}{fallback icon search path}.
Expand All @@ -1301,10 +1296,8 @@ void QIcon::setFallbackThemeName(const QString &name)
to bundle a \l{setThemeName()}{compliant theme} in one of your
themeSearchPaths(), and set the appropriate themeName().
\externalpage https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
\title Freedesktop Icon Naming Specification
\sa themeName(), fallbackIconTheme(), setThemeName(), themeSearchPaths(), fallbackSearchPaths()
\sa themeName(), fallbackThemeName(), setThemeName(), themeSearchPaths(), fallbackSearchPaths(),
{Freedesktop Icon Naming Specification}
*/
QIcon QIcon::fromTheme(const QString &name)
{
Expand All @@ -1327,7 +1320,7 @@ QIcon QIcon::fromTheme(const QString &name)
\l{themeName()}{current icon theme}.
If the current theme does not provide an icon for \a name,
the \l{fallbackIconTheme()}{fallback icon theme} is consulted,
the \l{fallbackThemeName()}{fallback icon theme} is consulted,
before falling back to looking up standalone icon files in the
\l{QIcon::fallbackSearchPaths()}{fallback icon search path}.
Expand All @@ -1341,7 +1334,7 @@ QIcon QIcon::fromTheme(const QString &name)
\snippet code/src_gui_image_qicon.cpp 4
\sa fallbackIconTheme(), fallbackSearchPaths()
\sa fallbackThemeName(), fallbackSearchPaths()
*/
QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback)
{
Expand Down

0 comments on commit b5169b5

Please sign in to comment.