Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, April 2008
Model/View and GraphicsView


Message 1 in thread

Hi all,
I'm developing a model/view based application with Qt 4.3, which could
have tens of thousands of items (each item represents a bounding
rectangle and a filename) organized in a spatial heirarchy. So far so
good, my TreeView handles the data well.
What I want to do also is to render the bounding boxes of the items in a
QGraphicsView, to take advantage of its BSP optimization.
What would be the most suitable way of "connecting" my
QAbstractItemModel derived object with a QGraphicsView? The best I can
come up with so far is to for my QGraphicsItem class to have a pointer
to the the data item it represents, and to get the bounding box from
that. Then to maybe have a signal to say whether the item is about to be
deleted or acted upon in some way. But this _seems_ to be not very Qt,
if you see what I mean.
Is it feasable to have a class that is derived from QAbstractItemView
and QGraphicsView that would do the job in a neat way?

Regards,
John Donovan - Virtalis Ltd.

______________________________________________________________________
This email has been scanned for Virtalis Ltd by the MessageLabs Email Security System. ______________________________________________________________________

--
 [ signature omitted ]