]> git.cworth.org Git - apitrace/blobdiff - gui/apicalldelegate.cpp
Removed unused copy of thumbnails.
[apitrace] / gui / apicalldelegate.cpp
index 11ed3a5ca03d5c59c96b8c7bc05c67e2e5583bf8..c68717580ddc6e5e5d94f3b95eb9fd27b8d6cf45 100644 (file)
@@ -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<ApiTraceFrame*>(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());