Results 1 to 2 of 2

Thread: How do I create a minimap?

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How do I create a minimap?

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How do I create a minimap?

    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.

Similar Threads

  1. Create QTextStream
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2007, 20:25
  2. How to create a standalone executable?
    By Ashish in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 15:04
  3. how to create resource fork & data fork
    By jyoti in forum General Discussion
    Replies: 4
    Last Post: 28th November 2006, 17:20
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 16:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.