A simpler way to find the (visual) position of a QModelIndex in a QTreeView

I am interested in calculating the physical position of a node in QTreeView and cannot find a way to do this (other than calculating it myself, which is cumbersome and error prone, given the reliability of QTreeView ).

Is there a standard way to find the output position of data associated with QModelIndex (something similar to the way indexAt() displays the position in QModelIndex )?

+6
c ++ model-view-controller qt qtreeview qmodelindex
source share
1 answer

QAbstractItemView has a method that does exactly what I need:

Signature:

 virtual QRect visualRect ( const QModelIndex & index ) const 
+9
source share

All Articles