tags:

views:

306

answers:

1

Greetings,

I'm interested in calculating the physical position of a node in QTreeView and can't find a way to do this (other than calculating it myself, which is cumbersome and error prone given the robustness of QTreeView).

Is there a standard way of finding the draw position of data associated with a QModelIndex (something similar to the way indexAt maps a position to a QModelIndex)?

Edit: virtual QRect visualRect ( const QModelIndex & index ) const Looks like it should work fine, my apologies! Downvote the question or answer if you like :)

A: 

As I mentioned in my edit there's a method in QAbstractItemView that does exactly what I needed:

virtual QRect visualRect ( const QModelIndex & index ) const is the signature!

Dan O