MCPcopy Create free account
hub / github.com/KDE/kdevelop / paint

Method paint

plugins/cmake/testing/qttestdelegate.cpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void 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
52void QtTestDelegate::highlight(QStyleOptionViewItem& option, const KStatefulBrush& brush, bool bold) const
53{

Callers 1

drawCheckBoxMethod · 0.45

Calls 3

paintFunction · 0.85
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected