Results 1 to 4 of 4

Thread: Reset my QgraphisPixmapItem position

  1. #1
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Reset my QgraphisPixmapItem position

    Hello there,

    I m doing a frogger. I did create my "vehicule" item gave it a position, move it with QObject::connect(&timer, SIGNAL(timeout()), &scene, SLOT(advance()));
    however, how can I make it go back to his original position and and let it do his animation again. How can I detect the end how my scene should I use QRectF boundingRect() const;

    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reset my QgraphisPixmapItem position

    QGraphicsItem::setPos() allows you to set any position you want, so also to set the coordinates that coincide with "start position".

    Cheers,
    _

  3. #3
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Reset my QgraphisPixmapItem position

    Sure man for the setPos(). But how can I detect the end my scene?

    Regards.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reset my QgraphisPixmapItem position

    I am afraid I don't understand.

    Clearly you must have a specific situation that you consider to be the end, so check for that situation's values.

    Cheers,
    _

Similar Threads

  1. view position of mouse position in GraphicsScene
    By Raghaw in forum Qt Programming
    Replies: 2
    Last Post: 23rd August 2012, 04:46
  2. QDockWidget -> Reset all
    By pl01 in forum Qt Programming
    Replies: 2
    Last Post: 24th March 2011, 12:11
  3. Replies: 1
    Last Post: 9th February 2010, 12:11
  4. reset QwtPlot
    By sarefo in forum Qwt
    Replies: 1
    Last Post: 24th January 2008, 08:00
  5. QImage reset
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2007, 10: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.