| 23 | } |
| 24 | |
| 25 | void QtTestDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const |
| 26 | { |
| 27 | const QString line = index.data().toString(); |
| 28 | QStyleOptionViewItem opt = option; |
| 29 | if (line.startsWith(QLatin1String("PASS :"))) |
| 30 | { |
| 31 | highlight(opt, passBrush); |
| 32 | } |
| 33 | else if (line.startsWith(QLatin1String("FAIL! :"))) |
| 34 | { |
| 35 | highlight(opt, failBrush); |
| 36 | } |
| 37 | else if (line.startsWith(QLatin1String("XFAIL :")) || line.startsWith(QLatin1String("SKIP :"))) |
| 38 | { |
| 39 | highlight(opt, xFailBrush); |
| 40 | } |
| 41 | else if (line.startsWith(QLatin1String("XPASS :"))) |
| 42 | { |
| 43 | highlight(opt, xPassBrush); |
| 44 | } |
| 45 | else if (line.startsWith(QLatin1String("QDEBUG :"))) |
| 46 | { |
| 47 | highlight(opt, debugBrush); |
| 48 | } |
| 49 | QItemDelegate::paint(painter, opt, index); |
| 50 | } |
| 51 | |
| 52 | void QtTestDelegate::highlight(QStyleOptionViewItem& option, const KStatefulBrush& brush, bool bold) const |
| 53 | { |
no test coverage detected