qt5base-lts/examples
Tor Arne Vestbø 0a93db4d82 Unify application palette handling between QGuiApplication and QApplication
The logic is now mostly handled in QGuiApplication, with QApplication
only dealing with the widget-specific palettes and interaction between
the style and the palette.

The application now picks up changes to the platform theme and will
re-resolve the current application palette appropriately. This also
works even if an explicit application palette has been set, in which
case any missing roles are filled in by the theme.

The palette can now also be reset back to the default application
palette that's fully based on the theme, by passing in the default
constructed palette (or any palette that doesn't have any roles set).
This is also correctly reflected in the Qt::AA_SetPalette attribute.

Conceptually this means QGuiApplication and QApplication follow the
same behavior as QWidget, where the palette falls back to a base or
inherited palette for roles that are not set, in this case the theme.

Behavior-wise this means that the default application palette of the
application does not have any roles set, but clients should not have
relied on this, nor does QWidget rely on that internally.

It also means that setting a palette on the application and then
getting it back again will not produce the same palette as set,
since the palette was resolved against the theme in the meantime.
This is the same behavior as for QWidget, and although it's a
behavior change it's one towards a more sane behavior, so we
accept it.

[ChangeLog] Application palettes are now resolved against the platform's
theme palette, the same way widget palettes are resolved against their
parents, and the application palette. This means the application palette
reflected through QGuiApplication::palette() may not be exactly the same
palette as set via QGuiApplication::setPalette().

Change-Id: I76b99fcd27285e564899548349aa2a5713e5965d
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-13 16:53:05 +01:00
..
aggregate install a sane top-level examples.pro file 2012-12-11 13:37:57 +01:00
corelib Deprecate QJsonDocument methods for converting to/from JSON binary 2020-01-09 13:52:25 +01:00
dbus Examples: cleanup foreach usage 2019-02-02 12:49:19 +00:00
embedded QNetworkReply: deprecate the 'error' getter 2020-01-13 15:50:47 +01:00
gui Examples/OpenGLWindow: do not use hardcoded indices 2019-10-02 08:36:36 +02:00
network QNetworkReply: deprecate the 'error' getter 2020-01-13 15:50:47 +01:00
opengl Merge remote-tracking branch 'origin/5.14' into 5.15 2019-11-08 09:11:02 +01:00
qmake Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qpa Examples: cleanup foreach usage 2019-02-02 12:49:19 +00:00
qtconcurrent Convert uses of QTime as a timer to QElapsedTimer 2019-06-14 10:42:33 +02:00
qtestlib Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00
sql Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
vulkan Fix use of qrand/qsrand in an example 2019-04-01 14:39:53 +00:00
widgets Unify application palette handling between QGuiApplication and QApplication 2020-01-13 16:53:05 +01:00
xml Deprecate SAX classes in Qt XML 2020-01-06 18:13:01 +01:00
examples.pro Doc: Move touch examples around so they get included in docs 2018-09-14 03:56:22 +00:00
README

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.