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. Position in itemChange
QtWS25 Last Chance

Position in itemChange

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 329 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.
  • S Offline
    S Offline
    sihnatse
    wrote on last edited by
    #1

    Virtual function in QGraphicsItem interface

    QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
    

    strangely provides value that either in scene or local coordinates. Maybe anyone has idea why?

    Problem description: At first, when all graphics items get shown, value always is in scene coordinate. Moving any item works fine. Then, after move is completed, the next move makes value to be in local coordinate. Visually it appears as sudden jump to the origin (0,0).

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Implemented like that ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Implemented like that ?

        S Offline
        S Offline
        sihnatse
        wrote on last edited by
        #3

        @SGaist Thanks for reply. Yes, like that. I suspect some initialization state on scene/view/items, because after value switches to local item coordinates, it says in local coordinates all the time.

        PS. There is more logic in itemChange in fact, but it all commented out to localize the problem.

        SGaistS 1 Reply Last reply
        0
        • S sihnatse

          @SGaist Thanks for reply. Yes, like that. I suspect some initialization state on scene/view/items, because after value switches to local item coordinates, it says in local coordinates all the time.

          PS. There is more logic in itemChange in fact, but it all commented out to localize the problem.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @sihnatse do you have the same issue if you use only the code of the doc snippet ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          1
          • SGaistS SGaist

            @sihnatse do you have the same issue if you use only the code of the doc snippet ?

            S Offline
            S Offline
            sihnatse
            wrote on last edited by
            #5

            @SGaist Yes, if the doc snippet is copypasted, and everything else is commented out, - same issue.

            I'll try on new project, maybe got any new ideas.

            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