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

Method paint

src/openms_gui/source/VISUAL/TOPPASInputFileListVertex.cpp:59–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void TOPPASInputFileListVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
60 {
61 TOPPASVertex::paint(painter, option, widget);
62
63 // display number of input files
64 QString text = QString::number(getFileNames().size())
65 + " input file"
66 + (getFileNames().size() == 1 ? "" : "s");
67 QRectF text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
68 painter->drawText(-(int)(text_boundings.width() / 2.0), (int)(text_boundings.height() / 4.0), text);
69
70 // display file type(s)
71 QStringList text_l = TOPPASVertex::TOPPASFilenames(getFileNames()).getSuffixCounts();
72 text = text_l.join(" | ");
73 // might get very long, especially if node was not reached yet, so trim
74 text = text.left(15) + " ...";
75 text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
76 painter->drawText(-(int)(text_boundings.width() / 2.0), 35 - (int)(text_boundings.height() / 4.0), text);
77 }
78
79 QRectF TOPPASInputFileListVertex::boundingRect() const
80 {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected