Results 1 to 6 of 6

Thread: GraphicsView/GraphicsScene does not update

  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Question GraphicsView/GraphicsScene does not update

    Hi!
    I have a small numerical software http://seis.bris.ac.uk/~rs1909/pdde/
    that uses GraphicsView/GraphicsScene. This used to work with Qt 4.3, but does not work with v.4.4 anymore. When adding items to GraphicsScene the view does not update, only when I resize the window. I was trying to add update(sceneRect()); all over the place, but still not working. Especially the rubberband of selecting a region does not even appear when I move to mouse, while it has nicely worked with 4.3.

    Does anybody know what change could have caused this behaviour? Unfortunately I cannot give a small testcase yet, that would take some time.
    Bests,
    Robert

  2. #2
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: GraphicsView/GraphicsScene does not update

    Most surprisingly the update happens occasionally, though rarely. Is it an event loop problem, that is events do not propagate as they should? Most interestingly the rubberband shows sometimes if I am out of the plotting region, but it does not otherwise.
    -R

  3. #3
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Lightbulb Re: GraphicsView/GraphicsScene does not update

    I've found out the reason. The event handling for key and mouse event were buggy before Qt 4.4 so I had to reimplement QGraphicsScene::event() to handle events. In earlier versions it seemed that keyPressEvent went to /dev/null. After removing this reimplementation everything work fine again.
    -R

  4. #4
    Join Date
    Nov 2007
    Posts
    26
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GraphicsView/GraphicsScene does not update

    Hi,

    I'm experiencing a similar thing.

    I have reimplemented some qgraphicsview mouse events so that I can scroll around by holding down the middle mouse button (the same as qgraphicsview::ScrollHandDrag except using the middle mouse button). It worked ok up until 4.4.0 but now it is as if only some of the events get passed through.

    Have enclosed an example, hold the middle mouse button to pan around.

    Any suggestions?
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GraphicsView/GraphicsScene does not update

    Hi, I have a similar problem.
    I'm using the standart rubberband selection but it does not refresh the QGraphicsView. It paints many rectangles and does not erase them.
    Any Ideas.
    I've attached a snapshot.
    Attachment 4236
    Thanks

  6. #6
    Join Date
    Jan 2010
    Location
    Istanbul, Turkey
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GraphicsView/GraphicsScene does not update

    Your attachment can't be downloaded. Could you check it please?

    I have rubberband problem with PyQt4.6 but not with CPP+Qt4.

    And I have also the fitting problem. When I add new items or move the existing items, view can not fit although it's given correct sceneRect coordinates.

Similar Threads

  1. drawForeground update trouble
    By spud in forum Qt Programming
    Replies: 6
    Last Post: 28th March 2011, 01:46
  2. Paintevent and update
    By csvivek in forum Qt Programming
    Replies: 1
    Last Post: 25th March 2008, 08:09
  3. QPainter update()
    By csvivek in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2008, 10:42
  4. why there is no update on maximize? [QTableWidget]
    By macias in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 16:01
  5. How to update statusbar and tooltips
    By aamer4yu in forum Qt Programming
    Replies: 9
    Last Post: 21st December 2006, 13:38

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.