I have a QTableView and i am using a custom delegate to display the content in the table view. I have subclassed the QStyledItemDelegate class and reimplemented the paint() function. Now, i want to increase the height of the table view row so that only 8 rows are visible at a time. I tried reimplementing the sizeHint() function of QStyledItemDelegate class but it's not getting invoked at all. I even added exit(1) inside the function to check if it is being invoked.

I don't get why it's not being called. I reimplemented the paint function and it's called automatically so what's the problem with sizeHint()?