in einem Itemdelegate eines Views Zeichne ich in eine Spalte nebeneinanderstehend immer Wochentage:
Code: Alles auswählen
while (!retrospectiveData.isEmpty()) {
QString color = retrospectiveData.at(0);
QString dayOfMonth = QString( retrospectiveData.at(1) ) + retrospectiveData.at(2);
retrospectiveData.remove(0, 3);
if (color == "g") {
painter->setPen(QColor(37, 203, 7));
}
else if (color == "y") {
painter->setPen(QColor(215, 209, 0));
}
else if (color == "b") {
painter->setPen(QColor(20, 30, 190));
}
else if (color == "r") {
painter->setPen(QColor(210, 0, 0));
}
painter->drawText(x, y + (option.rect.height() / 2), dayOfMonth);
x = x + 17;
}Wie löse ich dieses am besten?