Results 1 to 3 of 3

Thread: QGraphicsScene's sceneRect() doesn't update

  1. #1
    Join Date
    Nov 2010
    Posts
    77
    Thanks
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsScene's sceneRect() doesn't update

    I've inherited from QGraphicsScene to implement my own event handlers for mousePressEvent, mouseMoveEvent and mouseReleaseEvent. When I draw onto the graphics scene, the sceneRect doesn't update. I assume that's because I made my own event implementations and they don't do some of the stuff that the default implementations do handle. What am I missing?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QGraphicsScene's sceneRect() doesn't update

    (...) and they don't do some of the stuff that the default implementations do handle. What am I missing?
    Looks to me like you've already answered your question

    When I draw onto the graphics scene, the sceneRect doesn't update
    Post the drawing code.

  3. #3
    Join Date
    Nov 2010
    Posts
    77
    Thanks
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene's sceneRect() doesn't update

    Quote Originally Posted by stampede View Post
    Post the drawing code.
    I would, except that I'm working on a class project where I'm not allowed to share my code with others. I can tell you however that none of my mouse event handlers call their default implementation if a shape is being drawn on the scene. I don't know if that poses a problem.

    Here's something else I found... Should I use
    Qt Code:
    1. void setSceneRect ( qreal x, qreal y, qreal w, qreal h )
    To copy to clipboard, switch view to plain text mode 
    to alter the scene rectangle when necessary or is there a cleaner way to go about doing this?

Similar Threads

  1. QGLWidget doesn't update
    By qtbnl in forum Qt Programming
    Replies: 12
    Last Post: 14th February 2011, 17:41
  2. Can't manually update QGraphicsScene
    By aladagemre in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2010, 21:52
  3. QGraphicsScene update?
    By Gurdt in forum Qt Programming
    Replies: 11
    Last Post: 17th April 2009, 09:03
  4. Replies: 1
    Last Post: 26th December 2007, 10:58
  5. QGraphicsScene: evolution of sceneRect
    By Pieter from Belgium in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2006, 15:11

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.