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

Method paint

src/openms_gui/source/VISUAL/TOPPASMergerVertex.cpp:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 void TOPPASMergerVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
31 {
32 TOPPASVertex::paint(painter, option, widget);
33
34 QString text = round_based_mode_ ? "Merge" : "Collect";
35 QRectF text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
36 painter->drawText(-(int)(text_boundings.width() / 2.0), (int)(text_boundings.height() / 4.0), text);
37
38 if (round_total_ != -1) // draw round number
39 {
40 text = QString::number(round_counter_) + " / " + QString::number(round_total_);
41 text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
42 painter->drawText(-(int)(text_boundings.width() / 2.0), 31, text);
43 }
44 }
45
46 QRectF TOPPASMergerVertex::boundingRect() const
47 {

Callers

nothing calls this directly

Calls 6

numberFunction · 0.85
drawTextMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
QRectFClass · 0.50
boundingRectMethod · 0.45

Tested by

no test coverage detected