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

Method paint

src/openms_gui/source/VISUAL/TOPPASSplitterVertex.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 }
76
77 void TOPPASSplitterVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
78 {
79 TOPPASVertex::paint(painter, option, widget);
80
81 QString text = "Split";
82 QRectF text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
83 painter->drawText(-(int)(text_boundings.width() / 2.0), (int)(text_boundings.height() / 4.0), text);
84
85 if (round_total_ != -1) // draw round number
86 {
87 text = QString::number(round_counter_) + " / " + QString::number(round_total_);
88 text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
89 painter->drawText(-(int)(text_boundings.width() / 2.0), 31, text);
90 }
91 }
92
93 QRectF TOPPASSplitterVertex::boundingRect() const
94 {

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