bin nun mit meinem delegate weiter.
Code: Alles auswählen
void AufgabenDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
drawBackground(painter, option, index);
QTextDocument doc;
if(index.data().toDate()<QDate::currentDate())
doc.setHtml("<body bgcolor=red>" + index.data().toString() + "</body>");
else
doc.setHtml(index.data().toString());
painter->save();
painter->translate(option.rect.topLeft());
QRect r(QPoint(0, 0), option.rect.size());
doc.drawContents(painter, r);
painter->restore();
drawFocus(painter, option, option.rect);
}
Dann noch 2 Fragen:
Gibt es eine Elegantere Lösung als diesen HTML Wrap?
Wie bekomm ich hier eine Checkbox zurückgegeben?
Gruß Floppy