See the docs:
Qt3:
QListViewItem::setRenameEnabled ( int col, bool b )

Qt4:
Override QAbstractItemModel::flags() to return Qt::ItemIsEditable.