- QStyledItemDelegate::paint(painter, option, index);
- painter->drawStaticText(option.rect.topLeft(), text);
- } else{
+ //QStyledItemDelegate::paint(painter, option, index);
+ QStyle *style = QApplication::style();
+ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, 0);
+ if (event->hasState()) {
+ QPixmap px = m_stateEmblem.pixmap(option.rect.height(),
+ option.rect.height());
+ painter->drawPixmap(option.rect.topLeft(), px);
+ offset = QPoint(option.rect.height() + 5, 0);
+ }
+ 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());
+ painter->drawPixmap(option.rect.topLeft() + offset, px);
+ offset += QPoint(option.rect.height() + 5, 0);
+ }
+ }
+
+ painter->drawStaticText(option.rect.topLeft() + offset, text);
+ } else {