MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / measureTextWidth

Method measureTextWidth

app/src/UI/Widgets/PainterContext.cpp:1346–1349  ·  view source on GitHub ↗

* @brief Returns the rendered width of `text` under the current font. */

Source from the content-addressed store, hash-verified

1344 * @brief Returns the rendered width of `text` under the current font.
1345 */
1346qreal Widgets::PainterContext::measureTextWidth(const QString& text) const
1347{
1348 return QFontMetricsF(m_state.font).horizontalAdvance(text);
1349}
1350
1351/**
1352 * @brief Canvas-2D shaped measureText: returns { width, actualBoundingBoxAscent,

Callers 3

paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected