qt6-bb10/tests/auto/gui/image
Volker Hilsheimer 5f1fffc00e QIcon: add theme icon constants
Add a list of constant string literals for a subset of icons from the
freedesktop specification. Those are icons we document to support today,
and that users might have written themes for.

Omit icons that are mime types (we have Q(Abstract)FileIconProvider
and QPlatformTheme::fileIcon for that), the "flag-aa" icon (where 'aa'
is an ISO 3166 country code, and Face* icons. Flags and Face icons can
be added as supported QIcon constants, but should then be rendered as
emojis from the respective font (they are not provided by any of the
native icon libraries or icon fonts).

We use string constants instead of an enum so that we have the same code
path for icon constants, user-defined icons, and native icons. I.e. in
addition to QIcon::fromTheme(QIcon::ThemeIcon::EditCopy), code can
request the icon for "trash.circle.fill" on Apple platforms, or
or for U"\ue5cd" on platforms where the engine is font-based; or an app
can define their own icon name and provide the assets through a theme-
description, as before.

The downside is that we cannot use arrays for looking up the native icon
for an enum-value in the engine implementations, but given that icons
are cached this is an acceptable trade-off.

To make the list of icon contants more manageable, have them in a
separate header file. Since we want those constants to live in the QIcon
"namespace", we then include that header in a declaration of a nested
struct, "ThemeIcon", resulting in e.g. QIcon::ThemeIcon::EditCopy.

Change-Id: Ic20e36ab321e6c4b20806ec0b400bba13fffc983
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-07 12:39:06 +01:00
..
qicoimageformat Fix transparency in 16 bit and 24 bit ico files 2023-07-11 18:35:41 +00:00
qicon QIcon: add theme icon constants 2023-12-07 12:39:06 +01:00
qiconhighdpi CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qimage Fix smooth scaling of Format_Mono and Format_MonoLSB 2023-10-26 07:48:02 +03:00
qimageiohandler CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qimagereader QPpmHandler: fix reading ppm files 2023-11-27 19:53:41 +01:00
qimagewriter CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qmovie tst_QMovie: extend the test coverage for property bindings 2023-09-03 18:20:48 +02:00
qpicture CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qpixmap CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qpixmapcache CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00