Nice hint but in my case will not work because my custom widget sizeHint() changes dynamically depending on the contents in it.
When I create the editor I have other data class which I use to populate the data in the editor widget. After the data is populated the size hint will be calculated. The constructor for the delegate is called only once per item, and if my custom editor changes it's sizeHint the item will not be with proper size.
I have tried with mutable variable which I use in the function createEditor() to obtain correct sizeHint but it seems that it is too late, because the TreeView had already called the virtual funtion sizeHint() and I get improper item sizes...
I hope I was able to explain my case clear and that there is solution to this.![]()




Reply With Quote

Bookmarks