Hi, i want to customize a QTableWidgetItem after created but i get segmentation faults when retrieving the currentItem from a QTableWidget like this

Qt Code:
  1. aList->setItem(aList->rowCount()-2,
  2. 1,
  3. new QTableWidgetItem(tr("TOTAL :: ")));
  4. aList->currentItem()->setForeground(QBrush(Qt::darkRed));
To copy to clipboard, switch view to plain text mode 
why i can't use the QTWI returned by currentItem()? is there any way to do what im pretending the short way instead of creating the QTWI pointer and defining it before calling setItem()?

thanks