qt5base-lts/tests/auto
Volker Hilsheimer 1821f5163d Fix font and palette propagation for themed children created at runtime
Widgets have a default palette and font that is influenced by several
factors: theme, style, QApplication-wide overrides, and the parent's.
If an application sets a font or palette on a parent, then widgets
inherit those settings, no matter when they are added to the parent.

The bug is that this is not true for widgets that have an application-
wide override defined by the platform theme. For those, we need to merge
parent palette and font attributes with the theme, and this is currently
not done correctly, as the respective masks are not merged and inherited.

This change fixes this for fonts and palettes. Children are inheriting
their parent's inheritance masks, combined with the mask for the
attributes set explicitly on the parent. This makes the font and palette
resolving code correctly adopt those attributes that are set explicily,
while leaving everything else as per the theme override.

The test verifies that this works for children and grand children added
to a widget that has a palette or font set, both when themed and
unthemed. Children with own entries don't inherit from parent.

The QFont::resetFont test had to be changed, as it was testing the
wrong behavior. If the child would be added to the parent before the
font property was set, then the test would have failed. Since this
change makes sure that children inherit fonts in the same way, no
matter on when they are added to their parent, the test is now
modified to cover both cases, and ensures that they return identical
results.

[ChangeLog][QtWidgets][QWidget] Fonts and palette settings are inherited
by children from their parents even if the children have application-
wide platform theme overrides.

Change-Id: I179a652b735e85bba3fafc30098d08d61684f488
Fixes: QTBUG-82125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-20 08:04:47 +01:00
..
bic/data Add binary compatibility files for qtbase 5.14 branch 2019-12-20 10:41:11 +02:00
cmake CMake: Add support for auto-importing plugins in CMake 2019-08-12 18:23:58 +02:00
concurrent Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it 2019-07-12 14:26:30 +02:00
corelib Merge remote-tracking branch 'origin/5.14' into 5.15 2020-02-18 09:26:53 +01:00
dbus Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
gui Fix font and palette propagation for themed children created at runtime 2020-02-20 08:04:47 +01:00
guiapplauncher
installed_cmake
network Merge remote-tracking branch 'origin/5.14' into 5.15 2020-02-18 09:26:53 +01:00
opengl Remove dead code from Qt 4 times 2019-08-20 22:27:46 +00:00
other Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-28 08:09:51 +01:00
printsupport Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
shared QWindowsFontDatabase: Check preferred family names for all fonts 2019-11-29 09:31:21 +01:00
sql Merge remote-tracking branch 'origin/5.14' into 5.15 2019-12-10 13:51:40 +02:00
testlib testlib: Improve error message when detecting line count mismatch 2020-02-10 15:06:14 +01:00
tools moc: Record whether a meta object is an object, gadget, or namespace 2020-02-13 11:40:05 +01:00
widgets Fix font and palette propagation for themed children created at runtime 2020-02-20 08:04:47 +01:00
xml QNetworkReply: deprecate the 'error' getter 2020-01-13 15:50:47 +01:00
auto.pro
network-settings.h Merge remote-tracking branch 'origin/5.14' into 5.15 2020-02-18 09:26:53 +01:00