qt5base-lts/tests/auto/gui/text/qtextmarkdownimporter
Shawn Rutledge 17dca04a61 Use QTextCharFormat::fontFixedPitch to remember Markdown backtick spans
If the editing app (like qtbase/examples/widgets/richtext/textedit)
has controls only for setting a specific font, and someone uses it to
write markdown "from scratch", then we need to detect that they chose
Courier or some other fixed-pitch font, and write the backticks,
because Markdown has no syntax for selecting a specific font family.
If the user loads markdown into such an application, the font
is set to QFontDatabase::systemFont(QFontDatabase::FixedFont).
Round-trip editing was already working, as long as such a font exists.
QTextCharFormat::setFont() calls setFontFixedPitch(font.fixedPitch()),
but for the chosen "mono" font, font.fixedPitch() can be false.
For semantic completeness and separation of concerns, we now
set fontFixedPitch explicitly if a `backtick` span is encountered.
As a followup to f1e60de665 this
should get its autotest passing reliably.

Fixes: QTBUG-99676
Pick-to: 6.3 6.2 5.15
Change-Id: I4987a1f0f819f82ec64546bdc3ef53e7d29933de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-01-11 15:04:25 +00:00
..
data QTextMarkdownImporter: fix use after free; add fuzz-generated tests 2020-02-28 09:31:59 +01:00
BLACKLIST tst_qtextmarkdown: blacklist tests for QEMU ARMv7 2021-01-08 09:04:55 +02:00
CMakeLists.txt tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
tst_qtextmarkdownimporter.cpp Use QTextCharFormat::fontFixedPitch to remember Markdown backtick spans 2022-01-11 15:04:25 +00:00