Use QStyledItemDelegate or QAbstractItemDelegate and in paint() paint QCheckbox (), i.e.
QApplication::style()->drawControl( QStyle::CE_CheckBox, &cb_Style, painter );
To copy to clipboard, switch view to plain text mode
then create editor QCheckBox if You want save data into model.
Or simply in delegate paint() paint unchecked or checked box depending on the data, and change data not in delegate editor but in QTreeView signal clicked(QModelIndex). Connect that signal to slot and then use
int data = model->data(index, Qt::DisplayRole).toInt();
if( data == 0 )
data = 1;
else
data = 0;
model->setData(data, index );
int data = model->data(index, Qt::DisplayRole).toInt();
if( data == 0 )
data = 1;
else
data = 0;
model->setData(data, index );
To copy to clipboard, switch view to plain text mode
and delegate will autoamatically update view. So that way You don't create editor.
Bookmarks