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 woes, item position is wrong?!
Forum Updated to NodeBB v4.3 + New Features

QGraphicsView woes, item position is wrong?!

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 677 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    mwoehlke-kitware
    wrote on last edited by
    #1

    I'm trying to use the QGraphicsView and friends for the first time to create essentially a graph editor. I have subclassed QGraphicsView and have it drawing a grid with lines at every 100 px / 100 scene units.

    Now... I am creating some items with ::pos() = {0, 0}, {0, 100}, etc. However, the items are being drawn 200 px apart (i.e. two grid lines)! I am at a total loss as to why. If I fiddle with the view transform, I can get the grid to change as I would expect, and the item positions change also... but always they are two grid lines apart!

    I am at a loss here why this is happening... can someone help?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mwoehlke-kitware
      wrote on last edited by
      #2

      (er... sorry, should add, this is with Qt 5.3.2)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mwoehlke-kitware
        wrote on last edited by
        #3

        geez... and, answering my own question, apparently every bloody thing about QGraphicsItem is in "item coordinates"... which are translated by ::pos(). Sheesh.

        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