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. Scene/graphics view keeps putting my items in center
QtWS25 Last Chance

Scene/graphics view keeps putting my items in center

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 681 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
    Demmy
    wrote on last edited by
    #1

    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).

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      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