Results 1 to 5 of 5

Thread: Calling setPos() on custom QGraphicsPixmapItem doesn't update item in GraphicsScene

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Apr 2020
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Calling setPos() on custom QGraphicsPixmapItem doesn't update item in GraphicsSce

    I still don't know what I'm doing wrong, but here is another clue if it helps anyone.

    When I create a card, and set it to move right by 100 pixels and down by 100 pixels on a button click, a little bit of the image disappears with each click until it's gone completely (see photos). But I resize my window at any time, the card image pops back into full view, in the correct updated position. Either the QGraphicsView or QGraphicsScene is not registering changes in my card positions?

    Calling "m_pokerscene.update()" (m_pokerScene is my QGraphicsView) every time after I change the position of a Card item is a crude fix that works, but is cumbersome, should be unnecessary and would just cover up whatever my real problem is.

    Any thoughts? I appreciate it!
    Attached Images Attached Images

Similar Threads

  1. Replies: 7
    Last Post: 31st October 2010, 12:21
  2. QCursor::setPos() - doesn't work
    By Piskvorkar in forum Qt Programming
    Replies: 0
    Last Post: 21st March 2010, 13:24
  3. GraphicsView/GraphicsScene does not update
    By robicjedi in forum Qt Programming
    Replies: 5
    Last Post: 2nd February 2010, 23:33
  4. Replies: 1
    Last Post: 26th August 2009, 15:47
  5. How to move an item on a GraphicsScene
    By Holy in forum Qt Programming
    Replies: 17
    Last Post: 25th July 2008, 14:40

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
  •  
Qt is a trademark of The Qt Company.