diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/text/qfont/tst_qfont.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 06c0ba0819..2603206ab0 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -63,6 +63,7 @@ private slots: void defaultFamily_data(); void defaultFamily(); void toAndFromString(); + void fromStringWithoutStyleName(); void sharing(); }; @@ -561,6 +562,19 @@ void tst_QFont::toAndFromString() } } +void tst_QFont::fromStringWithoutStyleName() +{ + QFont font1; + font1.fromString("Noto Sans,12,-1,5,50,0,0,0,0,0,Regular"); + + QFont font2 = font1; + const QString str = "Times,16,-1,5,50,0,0,0,0,0"; + font2.fromString(str); + + QCOMPARE(font2.toString(), str); +} + + void tst_QFont::sharing() { // QFontCache references the engineData |