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

Method paint

src/openms_gui/source/VISUAL/TOPPASOutputFileListVertex.cpp:45–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 }
44
45 void TOPPASOutputFileListVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
46 {
47 TOPPASVertex::paint(painter, option, widget);
48
49 QString text = QString::number(files_written_) + "/"
50 + QString::number(files_total_) + " output file" + (files_total_ == 1 ? "" : "s");
51 QRectF text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
52 painter->drawText(-(int)(text_boundings.width() / 2.0), (int)(text_boundings.height() / 4.0), text);
53
54 // display file type(s)
55 QStringList text_l = TOPPASVertex::TOPPASFilenames(getFileNames()).getSuffixCounts();
56 text = text_l.join(" | ");
57 // might get very long, especially if node was not reached yet, so trim
58 text = text.left(15) + " ...";
59 text_boundings = painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, text);
60 painter->drawText(-(int)(text_boundings.width() / 2.0), 35 - (int)(text_boundings.height() / 4.0), text);
61
62 // output folder name
63 painter->drawText(painter->boundingRect(QRectF(0, 0, 0, 0), Qt::AlignCenter, output_folder_name_).width()/-2, -25, output_folder_name_);
64 }
65
66 void TOPPASOutputFileListVertex::setOutputFolderName(const QString& name)
67 {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected