summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-06-21 13:29:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-06-21 13:31:38 +0200
commit64033c35927efed044bac2eebd903304452abaa0 (patch)
tree02c24c5be42f18f74cba0d849a46efbceaaead44 /tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
parentbc8f871784431638b5c43e1977c31ce2060affd3 (diff)
Output all font families in HTML output
Fix our generation of font-family CSS so it contains the full list of families. Change-Id: I37d5efa64faeb4b6aeb7e2c5d6a54ff07febe9cc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp')
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index a07181c199..e4ee778f64 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -864,6 +864,18 @@ void tst_QTextDocument::toHtml_data()
{
CREATE_DOC_AND_CURSOR();
+ QTextCharFormat fmt;
+ fmt.setFontFamily("Times");
+ fmt.setFontFamilies(QStringList{ "Times", "serif" });
+ cursor.insertText("Blah", fmt);
+
+ QTest::newRow("font-family-with-fallback") << QTextDocumentFragment(&doc)
+ << QString("<p DEFAULTBLOCKSTYLE><span style=\" font-family:'Times','serif';\">Blah</span></p>");
+ }
+
+ {
+ CREATE_DOC_AND_CURSOR();
+
QTextBlockFormat fmt;
fmt.setNonBreakableLines(true);
cursor.insertBlock(fmt);