pmaktieh.sirhc
16th January 2007, 15:33
Hi,
I have a QTableView with a delegate, this sets the row height of the table view, via override sizeHint:
QSize MyClass::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QSize s = QItemDelegate::sizeHint(option, index);
if ( s.isValid() )
s.setHeight(20);
return s;
}
This works 100%. But if I set a new root index for the tableview:
void QAbstractItemView::setRootIndex ( const QModelIndex & index )
the row height is set to default height. The delegate is ignored! I need a fixed row height, also after a new root index!
Does anyone know, what the problem is? How can I fix this?
Thanks!
Chris
I have a QTableView with a delegate, this sets the row height of the table view, via override sizeHint:
QSize MyClass::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QSize s = QItemDelegate::sizeHint(option, index);
if ( s.isValid() )
s.setHeight(20);
return s;
}
This works 100%. But if I set a new root index for the tableview:
void QAbstractItemView::setRootIndex ( const QModelIndex & index )
the row height is set to default height. The delegate is ignored! I need a fixed row height, also after a new root index!
Does anyone know, what the problem is? How can I fix this?
Thanks!
Chris