Hi All,
So I've got a standard "boxes and lines" type application. Now I recently implemented autoscroll, so if you're dragging an item near the edge of the QGraphicsView, the view scrolls in that direction slowly. That works quite well.
However if you're dragging a rubberband box and drag your mouse near the edge of the graphics view, the scene moves while the rubberband doesn't. In other words, the rubber band in QGraphicsView (as in setDragMode(QGraphicsView::RubberBandDrag)) is relative to the view, and not the scene. This doesn't work with autoscroll, since I really want the rubberband to be relative to the scene, and thus expand when I'm dragging near the view edge.
I've tried using QRubberBand, but that won't work since it will be on top of everything. I suppose I could fake a rubber band by creating a QGraphicsItem to look like one, but that doesn't seem to be a very elegant solution, and it won't look like a native rubber band either. So is there any way to make the rubber band in graphics view relative to the scene instead of the view?
Thanks,
Leo




Reply With Quote
Bookmarks