Fix some compiler warnings from deprecated QFont constructor

QFont should be constructed with a list of font families.

Pick-to: 6.2
Change-Id: I61141b25d3f6e25f4fea141acbfa8e164d7af58f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-08-11 14:13:45 +02:00
parent f0bb95cb63
commit 761f32ae2a
2 changed files with 2 additions and 2 deletions

View File

@ -1763,7 +1763,7 @@ void tst_QAccessibility::textEditTest()
QString text = "<p>hello world.<br/>How are you today?</p><p>I'm fine, thanks</p>"; QString text = "<p>hello world.<br/>How are you today?</p><p>I'm fine, thanks</p>";
edit.setHtml(text); edit.setHtml(text);
if (pass == 1) { if (pass == 1) {
QFont font("Helvetica"); QFont font(QStringList{"Helvetica"});
font.setPointSizeF(12.5); font.setPointSizeF(12.5);
font.setWordSpacing(1.1); font.setWordSpacing(1.1);
edit.document()->setDefaultFont(font); edit.document()->setDefaultFont(font);

View File

@ -97,7 +97,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
// Draw text // Draw text
if (lod >= 2) { if (lod >= 2) {
QFont font("Times", 10); QFont font(QStringList{"Times"}, 10);
font.setStyleStrategy(QFont::ForceOutline); font.setStyleStrategy(QFont::ForceOutline);
painter->setFont(font); painter->setFont(font);
painter->save(); painter->save();