Scene/graphics view keeps putting my items in center

  • ok, I bet this one probably has a very easy solution; I have a scene and a graphicsView which my scene uses. It all works well, except:
    When I draw anything on it (I have connecting points on mouse click, basically something like making a multiline) it tends to put it in the middle of view/scene - this stops once when I reach graphicsView boundries (when it can no longer fit it inside the screen without scrolling).

    This is especially annoying at the start, when the scene is empty - for example I put a point on the left corner on the screen - it puts it in the middle.

    Additional information:
    I have tried @scene->setStickyFocus(false);@ but I guess that's not it since it keeps doing it anyway.
    setSceneRect prevents this at the cost of scrollbars (I need those).

  • Moderators

    I suspect you are not mapping the coordinates, and the default are (0, 0).

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.