- QStyledItemDelegate::paint(painter, option, index);
- painter->drawStaticText(option.rect.topLeft(), text);
- } else {
- ApiTraceFrame *frame = index.data().value<ApiTraceFrame*>();
- if (frame) {
- QStaticText text = frame->staticText();
- //text.setTextWidth(option.rect.width());
- QStyledItemDelegate::paint(painter, option, index);
- painter->drawStaticText(option.rect.topLeft(), text);
- } else {
- QStyledItemDelegate::paint(painter, option, index);
+ //QStyledItemDelegate::paint(painter, option, index);
+ QStyle *style = QApplication::style();
+ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, 0);
+ if (!event->state().isEmpty()) {
+ 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);
+ }