I'm making simple TODO-list in Qt, i want to "check" done items by changing their background color to green. I was looking for many hours but i only found how to change the hilight color. Can someone help me?
@EDIT
OMG, I'm sorry I forgot to write, I'm using QTreeWidget, I was trying to set the pointer to QTreeWidgetItem with
QTreeWidgetItem* ch = new QTreeWidgetItem();
ch = ui->TaskList->selectedItems();
ch->setBackground(0, Qt::green);
but it's not working.
I know how to set background on NEW item,
QTreeWidgetItem* tItem = new QTreeWidgetItem();
tItem->setText(0,ui->lineEdit->text());
tItem->setBackground(0, Qt::red);
@EDIT2
OK, I get how to do it
QList<QTreeWidgetItem*> ch;
ch = ui->TaskList->selectedItems();
foreach(QTreeWidgetItem * ch_item, ch)
ch_item->setBackground(0, Qt::green);