> On 2 Jun 2022, at 19:31, Scott Bloom <sc...@towel42.com> wrote:
> 
> I have a request, to open a dialog without out any eliding, which is easy 
> enough to do via the views textElideMode.
>  
> So I can resize all the columns to fit, pretty straight forward, if I don’t 
> set the textElideMode
>  
> However, they also want no the data to be full visible, and not have to 
> resize the dialog/scroll. 
>  
> However, I cant seem to find a proper “this is the size the treeview (though 
> the same issue exists for any abstractview) minimum size hnt that wont 
> require scrollbars.
>  
> Am I missing something obvious? (I must be)
> 
> Scott


There is no need for QTreeView to calculate a sizeHint for the entire tree, 
because, well, it is a scrollview :) And calculating a sizeHint would also mean 
that the view has to update layouts when data that influences the sizeHint 
changes, and that would be quite expensive (the view does have to do at least 
some of that anyway to adjust the scrollbars, but since scrolling is “per row” 
rather than “per pixel”, we can optimize that a lot; see 
QTreeViewPrivate::updateScrollBars()).

I think the best you can do is to get the visualRect of the last index, and 
then calculate the view’s sizeHint based on that. That means that the tree has 
to be fully expanded.


Volker

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to