1 #include "apicalldelegate.h"
3 #include "apitracecall.h"
10 ApiCallDelegate::ApiCallDelegate(QWidget *parent)
11 : QStyledItemDelegate(parent)
15 void ApiCallDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
16 const QModelIndex &index) const
18 ApiTraceCall *call = index.data().value<ApiTraceCall*>();
20 QStaticText text = call->staticText();
21 //text.setTextWidth(option.rect.width());
22 QStyledItemDelegate::paint(painter, option, index);
23 painter->drawStaticText(option.rect.topLeft(), text);
25 QStyledItemDelegate::paint(painter, option, index);
29 QSize ApiCallDelegate::sizeHint(const QStyleOptionViewItem &option,
30 const QModelIndex &index) const
32 ApiTraceCall *call = index.data().value<ApiTraceCall*>();
34 QStaticText text = call->staticText();
35 //text.setTextWidth(option.rect.width());
36 return text.size().toSize();
38 return QStyledItemDelegate::sizeHint(option, index);
42 #include "apicalldelegate.moc"