Results 1 to 3 of 3

Thread: Help with QGraphicsScene

  1. #1
    Join Date
    Jun 2010
    Posts
    22
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation Help with QGraphicsScene

    I need help with a small problem I can't seem to figure out. I'm drawing a grid and the width and height of each cell is changeable. Nothing is changed until I call the Update( QRECT) function. I came up with a quick solution to call it along with my drawGrid() function, but now it chokes the cpu since it is called all the time. A couple of segmentation faults later, I turned to you guys. Is there any way update the scene when it needs to be?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Help with QGraphicsScene

    If it's segfaulting, there's something wrong somewhere other than your updates. Have you tried running in a debugger to see where the program is failing?

  3. #3
    Join Date
    Jun 2010
    Posts
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help with QGraphicsScene

    I was the updates I made, so I removed those pieces of code. I saw in the documentation that the graphics view class had "setViewportUpdateMode ( ViewportUpdateMode mode )". Could this remedy the problem?

    EDIT:

    Fixed it. I connected a signal to the update() function. Works like a charm now!
    Last edited by justin123; 3rd June 2010 at 02:03.

Similar Threads

  1. Too Much RAM used by QGraphicsScene
    By grabalon in forum Qt Programming
    Replies: 4
    Last Post: 6th May 2010, 16:38
  2. Bug in QGraphicsScene?
    By tbcpp in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2009, 15:23
  3. in QGraphicsScene matrix of other QGraphicsScene
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 15th February 2009, 18:27
  4. QGraphicsSCene
    By bhogasena in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2009, 00:58
  5. Help on QGraphicsScene
    By Sandip in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2008, 15:20

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.