From af2daafde72db02454d24b7d691aa6861525ab99 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Nov 2019 17:01:26 +0100 Subject: Deprecate constructing QFlags from a pointer This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira --- src/gui/text/qfontmetrics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/text/qfontmetrics.cpp') diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index d3e4f11e8c..906047cdb4 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -562,7 +562,7 @@ int QFontMetrics::width(const QString &text, int len, int flags) const int numGlyphs = len; QVarLengthGlyphLayoutArray glyphs(numGlyphs); QFontEngine *engine = d->engineForScript(QChar::Script_Common); - if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, 0)) + if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, { })) Q_UNREACHABLE(); QFixed width; @@ -684,7 +684,7 @@ int QFontMetrics::horizontalAdvance(QChar ch) const glyphs.numGlyphs = 1; glyphs.glyphs = &glyph; glyphs.advances = &advance; - engine->recalcAdvances(&glyphs, 0); + engine->recalcAdvances(&glyphs, { }); return qRound(advance); } @@ -736,7 +736,7 @@ int QFontMetrics::charWidth(const QString &text, int pos) const glyphs.numGlyphs = 1; glyphs.glyphs = &glyph; glyphs.advances = &advance; - engine->recalcAdvances(&glyphs, 0); + engine->recalcAdvances(&glyphs, { }); width = qRound(advance); } @@ -1619,7 +1619,7 @@ qreal QFontMetricsF::horizontalAdvance(QChar ch) const glyphs.numGlyphs = 1; glyphs.glyphs = &glyph; glyphs.advances = &advance; - engine->recalcAdvances(&glyphs, 0); + engine->recalcAdvances(&glyphs, { }); return advance.toReal(); } -- cgit v1.2.3