PDA

View Full Version : different row heights in QTreeView



Qiieha
2nd October 2012, 10:54
Hi,
I subclassed QTreeView and QAbstractItemModel. The editing of different datatype is implemted via QItemEditorFactory.
It works, but now I want, that the rows in the QTreeView resizes to the appropriate editor or the appropriate content. When editing row 1, just row1 should be resized...

Does somebody know a solution?

Qiieha
2nd October 2012, 22:48
The correct implemenation of QStyledItemDelegate::sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const method solves the problem.

One point is still not clear: Sometimes the model doesn't refresh the resizing immediately. Ho I can trigger the refresh-slot?

thanks

Qiieha
3rd October 2012, 15:08
void QAbstractItemDelegate::sizeHintChanged ( const QModelIndex & index )