I have done some progresses, but have a problem retrieving the "item rect" (rW of marcel's last post); I tryed to get it with option.rect.width() but its value is zero and the application fault computing f. Here the new sizeHint:

Qt Code:
  1. QSize TextPainter::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
  2. {
  3. QFontMetrics fontMetrics = option.fontMetrics;
  4. QRect rect = fontMetrics.boundingRect(index.data().toString());
  5. float f = rect.width() / option.rect.width();
  6. int approxLineCount = int(f) + 1;
  7. return QSize(option.rect.width(), approxLineCount * fontMetrics.height());
  8. }
To copy to clipboard, switch view to plain text mode 

Regards