PDA

View Full Version : How do I create a minimap?



Morea
25th November 2007, 15:54
Hi.
I have two QGraphicsViews called small and big.
I've managed to scale down the small one, it looks awfull, but how can I make it so that a click or drag in the small view automatically scrolls the big map to the same position in the scene?

wysota
25th November 2007, 16:00
Reimplement the mousePress/mouseMove event of the small view and make it emit a signal that the view was clicked (and pass the scene coordinates as the argument). Then connect the signal to the other view's slot that will call QGraphicsView::centerOn.