]> git.cworth.org Git - apitrace/blobdiff - gui/apicalldelegate.cpp
Fix size comparisons in traceloader.cpp.
[apitrace] / gui / apicalldelegate.cpp
index dc9dc94a45248a50caf0a9941085a20d6367418a..221462e66b9996fdcff6b0c1f21a2d2b96753df5 100644 (file)
@@ -27,13 +27,24 @@ 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);
-        if (!event->state().isEmpty()) {
+
+        // draw thumbnail of frame
+        if(event->type() == ApiTraceEvent::Frame) {
+            ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
+            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());
             painter->drawPixmap(option.rect.topLeft(), px);