Results 1 to 3 of 3

Thread: Animate drawing

  1. #1
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Animate drawing

    Hi,
    I'd like to build some kind of slide show framework upon qt and am currently doing research on how to do it. Since I want to be able to let things move around I figured that QGraphicsItems which are kept in a QGraphicsScene and displayed in a QGraphicsview might be the right choice.
    There is a wide variety of implementations like QGraphicsEllipseItem, QGraphicsLineItem, ... already available. This totally satisfies my needs.

    However there is one thing I don't know how to realize.
    I'd like to let e.g. a path literally to be drawn.
    Like one would do it with a pencil, millimeter by millimeter.
    I cant find a suitable property of QGraphicsPathItem or QPainterPath which allows me to animate the drawing.

    I guess I will have to build a solution by myself by inheriting some classes.

    Can anyone point me in the right direction?
    Which classes do i have to inherit, which functions to override?

    Thanks in advance,
    best regards,

    ogh

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

    Default Re: Animate drawing

    Have a vector of control points and in each step add one more point from the vector to the path you draw. Of course you need many points for the path to be smooth.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    ogh (16th June 2011)

  4. #3
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Animate drawing

    Thanks a lot.
    I'll try that and am going to report about the performance as soon as I get it running.

Similar Threads

  1. animate buttons
    By kenouz1234 in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2010, 12:23
  2. Animate in Dialog
    By wirasto in forum Newbie
    Replies: 1
    Last Post: 11th December 2009, 11:34
  3. animate items
    By ensky_cy in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2009, 07:31
  4. animate a window
    By iGoo in forum Qt Programming
    Replies: 4
    Last Post: 27th June 2006, 10:46
  5. save animate to gif
    By Dmitry in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2006, 16:35

Tags for this Thread

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.