X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fapicalldelegate.cpp;h=c68717580ddc6e5e5d94f3b95eb9fd27b8d6cf45;hb=149e71e4b1dc7521d78b471747e3c4ab1c9b5ddf;hp=11ed3a5ca03d5c59c96b8c7bc05c67e2e5583bf8;hpb=ae2b4d32ed56e3ac193cc7205aeb58082c448ce8;p=apitrace diff --git a/gui/apicalldelegate.cpp b/gui/apicalldelegate.cpp index 11ed3a5..c687175 100644 --- a/gui/apicalldelegate.cpp +++ b/gui/apicalldelegate.cpp @@ -27,12 +27,23 @@ void ApiCallDelegate::paint(QPainter *painter, Q_ASSERT(index.column() == 0); if (event) { - QPoint offset; + QPoint offset = QPoint(0, 0); QStaticText text = event->staticText(); //text.setTextWidth(option.rect.width()); //QStyledItemDelegate::paint(painter, option, index); QStyle *style = QApplication::style(); style->drawControl(QStyle::CE_ItemViewItem, &option, painter, 0); + + // draw thumbnail of frame + if(event->type() == ApiTraceEvent::Frame) { + ApiTraceFrame *frame = static_cast(event); + const QImage & thumbnail = frame->thumbnail(); + if (!thumbnail.isNull()) { + painter->drawImage(option.rect.topLeft() + offset, thumbnail); + offset += QPoint(option.rect.height() + 16, 0); + } + } + if (event->hasState()) { QPixmap px = m_stateEmblem.pixmap(option.rect.height(), option.rect.height());