Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. I have a problem with GraphicsView

I have a problem with GraphicsView

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 97 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.
  • C Offline
    C Offline
    cuijg
    wrote last edited by cuijg
    #1

    7a752758-697d-451a-ab5a-8287a192e6de-image.png
    When I drag the vertical line in A with the mouse, the movement of the vertical line in B is always delayed;

    After I did this, the delay disappeared:

    A.onMouseMove: 
    {
         ... cur_scene_rect ...
    
         scene->setSceneRect(cur_scene_rect.left - 1,  ....);
         scene->setSceneRect(cur_scene_rect.left + 1,  ....);
         
         vline->setLine(....)
    }
    
    B.onMouseMoveFromA: 
    {
         ... cur_scene_rect ...
    
         scene->setSceneRect(cur_scene_rect.left - 1,  ....);
         scene->setSceneRect(cur_scene_rect.left + 1,  ....);
         
         vline->setLine(....)
    }
    

    Why is this? Why does calling setSceneRect to change scene_rect make the delay disappear, but if we don't call setSceneRect twice and keep scene_rect unchanged, there will be a delay?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cuijg
      wrote last edited by
      #2

      I asked Gemini and they removed the method of calling setSceneRect twice and replaced it with the method of graphicsview->viewport()->update(), which has the same effect.

      1 Reply Last reply
      0
      • C cuijg has marked this topic as solved

      • Login

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