diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-08-02 11:39:01 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-12-08 15:06:32 +0000 |
commit | 4d88d79aa507777bce40740b21747f656efc074d (patch) | |
tree | 0b335cac61062eaf281b5a76514f8bd74bbcaaf2 /tests/auto/widgets/widgets/qplaintextedit | |
parent | cd56e843cc53938111879c21570eaf8225719743 (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/widgets/widgets/qplaintextedit')
-rw-r--r-- | tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index af0ad1a601..a08a8862b8 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -870,7 +870,7 @@ void tst_QPlainTextEdit::lineWrapModes() // QPlainTextEdit does lazy line layout on resize, only for the visible blocks. // We thus need to make it wide enough to show something visible. int minimumWidth = 2 * ed->document()->documentMargin(); - minimumWidth += ed->fontMetrics().width(QLatin1Char('a')); + minimumWidth += ed->fontMetrics().horizontalAdvance(QLatin1Char('a')); minimumWidth += ed->frameWidth(); ed->resize(minimumWidth, 1000); QCOMPARE(lineCount(), 26); |