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

Method fillText

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

* @brief Draws filled text at (x, y) using the active font and fill style. */

Source from the content-addressed store, hash-verified

1299 * @brief Draws filled text at (x, y) using the active font and fill style.
1300 */
1301void Widgets::PainterContext::fillText(const QString& text, qreal x, qreal y)
1302{
1303 if (!active() || text.isEmpty())
1304 return;
1305
1306 const QPointF origin = alignTextOrigin(text, x, y);
1307
1308 if (shadowActive()) {
1309 QPainterPath p;
1310 p.addText(origin, m_state.font, text);
1311 QBrush brush = m_state.fillBrush;
1312 renderWithShadow([p, brush](QPainter* qp) { qp->fillPath(p, brush); }, p.boundingRect());
1313 }
1314
1315 m_painter->save();
1316 m_painter->setPen(QPen(m_state.fillBrush, 0));
1317 m_painter->setBrush(m_state.fillBrush);
1318 m_painter->setFont(m_state.font);
1319 m_painter->drawText(origin, text);
1320 m_painter->restore();
1321}
1322
1323/**
1324 * @brief Draws stroked text at (x, y) using the active font and stroke style.

Callers 15

drawLineFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80
stat_cardFunction · 0.80
paintFunction · 0.80
paintFunction · 0.80

Calls 4

isEmptyMethod · 0.80
saveMethod · 0.80
setFontMethod · 0.80
restoreMethod · 0.45

Tested by

no test coverage detected