qt5base-lts/examples/widgets/widgets
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
..
analogclock Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
calculator Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
calendarwidget Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
charactermap Replace usages of QVariant::value by qvariant_cast 2019-12-15 12:30:52 +01:00
codeeditor Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
digitalclock Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
elidedlabel Cleanup Widgets examples - includes 2019-01-28 19:37:43 +00:00
groupbox Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
icons Fix some qdoc warnings 2020-01-03 14:59:26 +01:00
imageviewer Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
lineedits Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
mousebuttons Remove usages of deprecated APIs of QWheelEvent 2019-08-23 21:51:43 +02:00
movie Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
scribble Merge remote-tracking branch 'origin/5.13' into 5.14 2019-11-13 07:21:33 +01:00
shapedclock Modernize shapedclock example 2019-12-10 00:38:40 +01:00
sliders Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
spinboxes Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
styles Unify application palette handling between QGuiApplication and QApplication 2020-01-13 16:53:05 +01:00
stylesheet Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
tablet Replace usages of QVariant::value by qvariant_cast 2019-12-15 12:30:52 +01:00
tetrix Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
tooltips Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
validators Replace usages of QVariant::value by qvariant_cast 2019-12-15 12:30:52 +01:00
wiggly Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
windowflags Cleanup QtWidgets (widgets) examples 2019-09-17 23:05:23 +02:00
README
widgets.pro Fix out-of-tree compilation of widget examples 2014-02-11 12:35:03 +01:00

Qt comes with a large range of standard widgets that users of modern
applications have come to expect.

You can also develop your own custom widgets and controls, and use them
alongside standard widgets.

It is even possible to provide custom styles and themes for widgets that can
be used to change the appearance of standard widgets and appropriately
written custom widgets.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.