MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / paint

Method paint

src/openms_gui/source/VISUAL/TOPPASVertex.cpp:168–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 void TOPPASVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /*widget*/, bool round_shape)
169 {
170 QPen pen(pen_color_, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
171 if (isSelected())
172 {
173 pen.setWidth(2);
174 painter->setBrush(brush_color_.darker(130));
175 pen.setColor(Qt::darkBlue);
176 }
177 else
178 {
179 painter->setBrush(brush_color_);
180 }
181 painter->setPen(pen);
182
183 QPainterPath path;
184 if (round_shape)
185 {
186 path.addRoundedRect(boundingRect().marginsRemoved(QMarginsF(1, 1, 1, 1)), 20, 20);
187 }
188 else
189 {
190 path.addRect(boundingRect().marginsRemoved(QMarginsF(1, 1, 1, 1)));
191 }
192 painter->drawPath(path);
193
194 pen.setColor(pen_color_);
195 painter->setPen(pen);
196
197 // topo sort number
198 painter->drawText(boundingRect().x() + 7, boundingRect().y() + 20, QString::number(topo_nr_));
199
200 // recycling status
201 if (this->allow_output_recycling_)
202 {
203 QSvgRenderer* svg_renderer = new QSvgRenderer(QString(":/Recycling_symbol.svg"), nullptr);
204 svg_renderer->render(painter, QRectF(-7, boundingRect().y() + 9.0, 14, 14));
205 }
206 }
207
208 QPainterPath TOPPASVertex::shape() const
209 {

Callers

nothing calls this directly

Calls 6

numberFunction · 0.85
drawTextMethod · 0.80
QStringClass · 0.50
QRectFClass · 0.50
setWidthMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected