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

Method brush

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

* @brief Materialises the gradient into a QBrush ready for QPainter binding. */

Source from the content-addressed store, hash-verified

221 * @brief Materialises the gradient into a QBrush ready for QPainter binding.
222 */
223QBrush Widgets::PainterGradient::brush() const
224{
225 QGradient* g = nullptr;
226 if (m_kind == Kind::Linear)
227 g = new QLinearGradient(m_x0, m_y0, m_x1, m_y1);
228 else if (m_kind == Kind::Radial)
229 g = new QRadialGradient(QPointF(m_x1, m_y1), m_r1, QPointF(m_x0, m_y0), m_r0);
230 else {
231 auto* cg = new QConicalGradient(m_x0, m_y0, qRadiansToDegrees(m_startRad));
232 g = cg;
233 }
234
235 g->setStops(m_stops);
236 QBrush b(*g);
237 delete g;
238 return b;
239}
240
241//--------------------------------------------------------------------------------------------------
242// PainterPattern

Callers 2

setFillStyleMethod · 0.80
setStrokeStyleMethod · 0.80

Calls 4

isEmptyMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
fillMethod · 0.45

Tested by

no test coverage detected