Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsView draw items not visible in view...

QGraphicsView draw items not visible in view...

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicsview
2 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    I have a graph with some lines. Some of the lines are very large, and the bounding box extend pass the screen, Sadly at that point QGraphicsView decides to not draw item & my line dissapears.

    Say if i Have a rect item at 500/500, and inside that item I have a path that stretches all the way to 0,0. But my view only show 100x100 rect. So the rect far away + path of it does not render.

    How can I "force" qgraphicsView to draw items regardless of their visibility on screen?

    TIA

    JonBJ 1 Reply Last reply
    0
    • D Dariusz

      Hey

      I have a graph with some lines. Some of the lines are very large, and the bounding box extend pass the screen, Sadly at that point QGraphicsView decides to not draw item & my line dissapears.

      Say if i Have a rect item at 500/500, and inside that item I have a path that stretches all the way to 0,0. But my view only show 100x100 rect. So the rect far away + path of it does not render.

      How can I "force" qgraphicsView to draw items regardless of their visibility on screen?

      TIA

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Dariusz
      I admit I have not tried it, but it would seem very strange to me if "Sadly at that point QGraphicsView decides to not draw item & my line dissapears.". I would expect it merely to clip whatever there is to the visible view area; if it omitted it completely QGraphicsView would surely be unusable.

      Say if i Have a rect item at 500/500, and inside that item I have a path that stretches all the way to 0,0.

      What do you mean by this? Are you putting further line items on top of a rect item as children? The vital thing is that you must not draw outside a QGraphicsItem::boundingRect() and QGraphicsItem::childrenBoundingRect(). If you do, the view will misdraw. You can override QGraphicsItem::boundingRect() for your items if you need to. Is this perhaps your situation?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved