summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qfontmetrics/tst_qfontmetrics.cpp')
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 4250415..eda421b 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -75,6 +75,7 @@ private slots:
void elidedMultiLength();
void elidedMultiLengthF();
void inFontUcs4();
+ void lineWidth();
};
tst_QFontMetrics::tst_QFontMetrics()
@@ -288,5 +289,22 @@ void tst_QFontMetrics::inFontUcs4()
QFontDatabase::removeApplicationFont(id);
}
+void tst_QFontMetrics::lineWidth()
+{
+ // QTBUG-13009, QTBUG-13011
+ QFont smallFont;
+ smallFont.setPointSize(8);
+ smallFont.setWeight(QFont::Light);
+ const QFontMetrics smallFontMetrics(smallFont);
+
+ QFont bigFont;
+ bigFont.setPointSize(40);
+ bigFont.setWeight(QFont::Black);
+ const QFontMetrics bigFontMetrics(bigFont);
+
+ QVERIFY(smallFontMetrics.lineWidth() >= 1);
+ QVERIFY(smallFontMetrics.lineWidth() < bigFontMetrics.lineWidth());
+}
+
QTEST_MAIN(tst_QFontMetrics)
#include "tst_qfontmetrics.moc"