Results 1 to 1 of 1

Thread: QGraphicsItem Jerky Movement?

  1. #1
    Join Date
    Oct 2012
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question QGraphicsItem Jerky Movement?

    Hello there,

    I am trying to make a qgraphicspixmapitem move with the arrow keys. It works to some degree, however, there is a minor delay when switching keys and it becomes slightly jerky. Is there a way to fix this?

    Here is the code for moving (You can simply ignore the lua parts):
    Qt Code:
    1. QList<QGraphicsItem*> temp = luascene->items();
    2. foreach(QGraphicsItem *itm,temp)
    3. {
    4. if( Sprite * node = dynamic_cast<Sprite*>( itm ) )
    5. {
    6. if (node->name == tempname)
    7. {
    8. node->setPos(node->x() + dir, node->y());
    9. }
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance guys,
    Matt
    Last edited by steadi; 10th November 2012 at 03:07.

Similar Threads

  1. Moving of QGraphicsItem
    By Erlendhg in forum Qt Programming
    Replies: 17
    Last Post: 5th November 2013, 15:04
  2. Replies: 0
    Last Post: 26th October 2012, 13:11
  3. Moving child QGraphicsItem
    By roband915 in forum Qt Programming
    Replies: 0
    Last Post: 27th February 2011, 12:19
  4. Moving QGraphicsItem with mouse
    By BrainFreeze in forum Qt Programming
    Replies: 9
    Last Post: 11th February 2011, 00:48
  5. QTimer stops after system time change
    By djurodrljaca in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2009, 20:36

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.