Q:

Draw tick mark in QTree

I want to draw a tick mark in a Qtreeview.  I don't want to have a checkbox but just to indicate an item.  Is there a way to do so?  
Thanks

A:

In your model's data() function, return a QIcon or QPixmap for the Qt::DecorationRole:
QVariant MyItemModel::data(const QModelIndex &index, int role) const
{
    ...
    if(role==Qt::DecorationRole)
    {
        if(currentItem.isChecked()) return QPixmap(":my_check_icon.png") // Checkmark Image
        else return QVariant(); // No checkmark
    }
}

