Hm, I now did it that way:
{
return createEditor(0, option, index)->sizeHint();;
}
QSize MyDelegate::sizeHint(const QStyleOptionViewItem & option,
const QModelIndex & index) const
{
return createEditor(0, option, index)->sizeHint();;
}
To copy to clipboard, switch view to plain text mode
This way the editor is created twice, which isn't really great but at least it works without having to use
return QSize(x,y);
To copy to clipboard, switch view to plain text mode
.
Is there an easier and better way?
Philipp
Bookmarks