Hi folks,
My QTableView is shown in the picture below. As you see the Online column and the Locked column are checkable.
But what I'm having difficulty with is how to customize the check indicator. I want my QTableView like what is shown in the following picture (it's gimped):
As you already might have guessed, I should implement this protected function in my delegate:
As you can see, I want to show two different images (actually four) considering which column is being rendered. But drawCheck doesn't provide any argument which shows which column is being rendered (like a QModelIndex).Qt Code:
void QItemDelegate::drawCheck ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, Qt::CheckState state ) constTo copy to clipboard, switch view to plain text mode
Bookmarks