]> git.cworth.org Git - apitrace/blobdiff - gui/apicalldelegate.cpp
Large chunk of functionality to show errors.
[apitrace] / gui / apicalldelegate.cpp
index c2a1b23f54f47172fcc59885989011b2c68c7d58..800fcddb1cc842ae95cf0bc69870bc15345a3578 100644 (file)
@@ -12,7 +12,8 @@
 ApiCallDelegate::ApiCallDelegate(QWidget *parent)
     : QStyledItemDelegate(parent),
       m_stateEmblem(":/resources/dialog-information.png"),
-      m_editEmblem(":/resources/document-edit.png")
+      m_editEmblem(":/resources/document-edit.png"),
+      m_errorEmblem(":/resources/script-error.png")
 {
 }
 
@@ -40,6 +41,12 @@ void ApiCallDelegate::paint(QPainter *painter,
         }
         if (event->type() == ApiTraceEvent::Call) {
             ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
+            if (call->hasError()) {
+                QPixmap px = m_errorEmblem.pixmap(option.rect.height(),
+                                                  option.rect.height());
+                painter->drawPixmap(option.rect.topLeft() + offset, px);
+                offset += QPoint(option.rect.height() + 5, 0);
+            }
             if (call->edited()) {
                 QPixmap px = m_editEmblem.pixmap(option.rect.height(),
                                                  option.rect.height());