Results 1 to 5 of 5

Thread: QGraphicsView::translate

Hybrid View

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

    Default Re: QGraphicsView::translate

    Is your scene bigger than your view? If not, translating the view won't change anything.

  2. #2
    Join Date
    Oct 2008
    Posts
    37
    Thanked 2 Times in 2 Posts

    Default Re: QGraphicsView::translate

    I see what you mean by that now. How do I translate the origin of my scene in a view so that it's somewhere other than dead center?

    Also - do you know if I can turn off that auto scroll when I add items close to the edge of the view?

    Thanks.

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

    Default Re: QGraphicsView::translate

    The view inherits QAbstractScrollArea. Dig out the rest yourself

    To anchor the scene to something else than the centre of the view (if it is smaller than the view) use the QGraphicsView::alignment property.

  4. #4
    Join Date
    Oct 2008
    Posts
    37
    Thanked 2 Times in 2 Posts

    Default Re: QGraphicsView::translate

    Thanks. That's a good starting point.

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.