57{
58 if (! index.isValid())
59 return;
60
62
63 if (option.state & QStyle::State_Selected) {
64 painter->setPen(QPen(option.palette.highlight(), 2.0));
65 painter->fillRect(option.rect, option.palette.highlight());
66 painter->setPen(option.palette.highlightedText().color());
67 }
68 else {
69 painter->setPen(option.palette.text().color());
70 }
71 int margin = option.rect.height() - painter->fontMetrics().height();
72 margin = floor(margin/2);
73 painter->drawText(option.rect.x() + 5, option.rect.y() + painter->fontMetrics().ascent() + margin, name);
74}
const char * name(StandardAction id)