qt6-bb10/tests/auto/gui/text
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
..
qabstracttextdocumentlayout
qcssparser Support missing white-space:pre-line CSS 2019-08-12 17:24:05 +01:00
qfont Fix font and palette propagation for themed children created at runtime 2020-02-20 08:04:47 +01:00
qfontcache Port from QAtomic::load() to loadRelaxed() 2019-06-20 20:48:59 +02:00
qfontdatabase QWindowsFontDatabase: Check preferred family names for all fonts 2019-11-29 09:31:21 +01:00
qfontmetrics Fix text shifting vertically when elided 2018-12-21 10:27:12 +00:00
qglyphrun unblacklist passing tests 2019-07-08 11:01:42 +00:00
qinputcontrol Accept all formatting characters as valid input 2017-01-26 10:59:49 +00:00
qrawfont [Windows] Fixed regression when creating fallback fonts 2019-02-14 08:01:05 +00:00
qstatictext Prefix QTextStream operators with Qt:: in tests 2019-05-03 09:36:36 +00:00
qsyntaxhighlighter Fix qtHaveModule(widgets) condition 2019-11-02 08:55:27 +01:00
qtextblock
qtextcursor Fix crash when detaching dangling QTextCursor 2018-09-27 06:51:37 +00:00
qtextdocument Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-07 01:01:16 +01:00
qtextdocumentfragment Fix assert in QTextDocument CSS parser on "border-width: 1pt" 2019-12-03 17:54:24 +01:00
qtextdocumentlayout Fix qtHaveModule(widgets) condition 2019-11-02 08:55:27 +01:00
qtextformat Update font when text format's letter spacing type is changed 2017-12-22 05:37:55 +00:00
qtextlayout Enable cursor in ligature test on Windows 2019-10-21 09:01:26 +02:00
qtextlist Tests: Fix some warnings about deprecated functions not under test 2019-05-27 15:29:16 +02:00
qtextmarkdownimporter Remove empty block at beginning of imported markdown 2020-01-13 09:25:39 +01:00
qtextmarkdownwriter Markdown importer: properly set hyperlinks 2020-02-03 14:58:06 +01:00
qtextobject
qtextodfwriter Add more formatting to QTextDocumentWriter when writing ODF files 2018-04-11 18:44:31 +00:00
qtextpiecetable Change almost all other uses of qrand() to QRandomGenerator 2017-11-08 09:14:03 +00:00
qtextscriptengine qtbase: Remove BLACKLIST files which are no longer active 2018-02-12 17:40:12 +00:00
qtexttable Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
qzip
text.pro Markdown: fix several issues with lists and continuations 2019-05-08 20:28:28 +00:00