| 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 | { |
nothing calls this directly
no test coverage detected