开发者

Easier way to find (visual) position of QModelIndex in QTreeView

开发者 https://www.devze.com 2022-12-11 06:51 出处:网络
I\'m interested in calculating the physical position of a node in QTreeV开发者_StackOverflow中文版iew and can\'t find a way to do this (other than calculating it myself, which is cumbersome and error

I'm interested in calculating the physical position of a node in QTreeV开发者_StackOverflow中文版iew 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)?


There's a method in QAbstractItemView that does exactly what I needed:

The signature is:

virtual QRect visualRect ( const QModelIndex & index ) const
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号