summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qfontdatabase
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2017-08-02 11:39:01 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2017-12-08 15:06:32 +0000
commit4d88d79aa507777bce40740b21747f656efc074d (patch)
tree0b335cac61062eaf281b5a76514f8bd74bbcaaf2 /tests/auto/gui/text/qfontdatabase
parentcd56e843cc53938111879c21570eaf8225719743 (diff)
Update usage of QFontMetrics::width() to new API
QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qfontdatabase')
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index e52cb63384..ebe9d3b992 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -312,7 +312,7 @@ void tst_QFontDatabase::condensedFontWidth()
QFont testFontCondensed("QtBidiTestFontCondensed");
QFontMetrics fmTF(testFont);
QFontMetrics fmTFC(testFontCondensed);
- QVERIFY(fmTF.width(testString()) > fmTFC.width(testString()));
+ QVERIFY(fmTF.horizontalAdvance(testString()) > fmTFC.horizontalAdvance(testString()));
}
@@ -335,15 +335,15 @@ void tst_QFontDatabase::condensedFontMatching()
QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue);
#endif
- QCOMPARE(QFontMetrics(tfcByStretch).width(testString()),
- QFontMetrics(tfcByStyleName).width(testString()));
+ QCOMPARE(QFontMetrics(tfcByStretch).horizontalAdvance(testString()),
+ QFontMetrics(tfcByStyleName).horizontalAdvance(testString()));
if (!db.hasFamily("QtBidiTestFontCondensed"))
QSKIP("This platform doesn't support font sub-family names (QTBUG-55625)");
QFont tfcBySubfamilyName("QtBidiTestFontCondensed");
- QCOMPARE(QFontMetrics(tfcByStyleName).width(testString()),
- QFontMetrics(tfcBySubfamilyName).width(testString()));
+ QCOMPARE(QFontMetrics(tfcByStyleName).horizontalAdvance(testString()),
+ QFontMetrics(tfcBySubfamilyName).horizontalAdvance(testString()));
}
void tst_QFontDatabase::rasterFonts()