I'm not sure what you mean by putting them together. You can have an item that represents the background of the graph (axis, etc.) and have multiple items that are child items of the graph item representing the contents of the graph (points).
For splitting space usually an algorithm called BSP (binary space partitioning) is used. It splits the plane into two sub-planes and then splits each sub-plane again and again until it reaches the stop condition. GraphicsView uses that algorithm internally to quickly find items based on their geometry. If you decided to represent each point in the graph as separate item, you could automatically use that built-in mechanism but if you want to have clusters, you have to implement BSP yourself.now,according to your direction, my thought is : splitter QVector<QPointF> vector which stores all the points to several segment, and then draw each segment's points on an item, but how can i put these items together appropriately just to compose integrate and correct graph, this means how i know where to put these small items, and how can i map each segment points to corresponding item's coordinate.
Qt does that for you. It will only repaint items that need repainting (i.e. those that are visible and have been marked as dirty).and how can i determin which items should be repainted
A rule of a thumb is that if you have one item in the scene - you probably shouldn't be using QGraphicsView at all as it only adds to the complexity giving nothing in exchange. If you want to use Graphics View, have multiple items. Group them as you want using the parent-child relationship and squeeze as much from the architecture as possible.
If you only want a single item with zooming and scrolling, you'll get much better results with a custom widget derived from QAbstractScrollArea.
Bookmarks