Results 1 to 2 of 2

Thread: Animation of QPainterpaths in QGraphicsScene in QGraphicsView

  1. #1
    Join Date
    Jan 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Animation of QPainterpaths in QGraphicsScene in QGraphicsView

    Hi

    I've pretty much got the end game with my "Teach Yourself Qt" project and need some advice on animation of profiles in Qt.

    I have a number of 2D profiles described by lines and arcs created as QPainterPaths starting at (0,0), and all created on a separate QGraphicsScene.

    The bounding rectangles of all of these QPainterPaths are different.

    When I show the QGraphicsScenes in order on the QGraphicsView I want the original QPainterPath origin to be located at the same point in the QGraphicsView.

    I suppose it is analogous to an animation about a fixed point.

    The problem is that each QGraphicsScene gets automatically centered at each iteration which moves the required QGraphicsScene fixed point about the QGraphicsView and I don't get the required effect.

    Anyone have any thoughts?

    Thanks

    Brian

  2. #2
    Join Date
    Jan 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Animation of QPainterpaths in QGraphicsScene in QGraphicsView

    Hi

    I've programmed a workaround to calculate the maximun bounding rectangle for each QGraphicsScene by a read through the data before displaying it and then adding this maximum bounding rectangle to each QGraphicsScene when it is displayed. It works as expected now, but it's a bit of a chicken before the egg solution :-).

    I have experimented with MapFromScene and MapToScene suspecting that may offer a solution but with little sucess.

    Brian

Similar Threads

  1. QGraphicsView and animation framework
    By Diph in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2010, 22:22
  2. Animation of QGraphicsItem in QGraphicsView
    By mirelon in forum Qt Programming
    Replies: 4
    Last Post: 19th December 2009, 15:25
  3. QGraphicsView animation performance
    By rakkar in forum Newbie
    Replies: 8
    Last Post: 3rd September 2009, 04:14
  4. Replies: 3
    Last Post: 12th July 2008, 22:51
  5. QGraphicsView animation issues?
    By m41n1 in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2008, 07:48

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.