Results 1 to 6 of 6

Thread: Moving the QGraphicsScene background content

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Moving the QGraphicsScene background content

    Hi guys,

    I am currently looking for the fastest solution for scrolling GraphicsScene background left or right. Let's say that I am drawing a world map in the background (extent -180,180) and the (0.0,0.0) is the center. The user though, can change the center of the map and scroll it left/right. I am currently thinking about using coordinates translation for achieving this feature.
    Any other ideas? Thank you beforehand.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    May 2008
    Location
    London, UK
    Posts
    8
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Moving the QGraphicsScene background content

    Are you sure that that's what you want to do? Why not just scroll the graphics view across the background?

    If you're trying to scroll the entire scene, just scroll the view instead...

  3. #3
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the QGraphicsScene background content

    Hi,

    Thanks for the advice. Yet, I am not sure which option to choose. That's why I am writing here.
    After scrolling the scene/view I will have draw some additional data, still considering the "offset" and draw in according to the scroll.
    Maybe scrolling the view is ok, I will check it.

    Thanks

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  4. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the QGraphicsScene background content

    Hi,

    When I set chart extent to (-360,-90),(360,90) I can scroll left/right, but how to redraw the part of the chart which disappears on the right to be drawn on left. Maybe it can be simple, but I can't find a way to achieve this for the time being. Any idea?

    THanks
    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  5. #5
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the QGraphicsScene background content

    Hi,

    Any idea how to achieve this king of scrolling, described above?

    THanks.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  6. #6
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the QGraphicsScene background content

    Anyone?

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Moving an item in QGraphicsScene
    By prosass in forum Newbie
    Replies: 4
    Last Post: 28th March 2007, 15:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.