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. Does addition sequence of different lines into scene affects their selection through mouse in qt ?

Does addition sequence of different lines into scene affects their selection through mouse in qt ?

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

    In my QGraphicsView, I have 1 polyline ( p1) and 2 straight lines ( s1 , & s2 ) and I have shown left and right part of the polyline by Left and right respectively.

    s.PNG

    I am showing insertion sequence of p1, s1 and s2 into scene and which line I am able to select by mouse.

    (seuence is from left to right ) i.e. left most will added 1st and right most will be added last.
    s2 , s1, p1 - p1 and (s2 through it's left part it can be selected )
    p1 , s2, s1 - all can be selected.
    s2, p1, s1 - p1 , s1 and (s2 through its left part it can be selected )
    s1, p1, s2 - p1 and s2 selected.
    p1, s1, s2 - All are selected
    s1, s2, p1 - p1 and (s2 only through its left part )

    I want every line gets selected, once we click on it. Addition sequence of such shaped polyline matters ?
    Is there any way in Qt, through which I can resolve above problem ?

    T 1 Reply Last reply
    0
    • T tushu

      In my QGraphicsView, I have 1 polyline ( p1) and 2 straight lines ( s1 , & s2 ) and I have shown left and right part of the polyline by Left and right respectively.

      s.PNG

      I am showing insertion sequence of p1, s1 and s2 into scene and which line I am able to select by mouse.

      (seuence is from left to right ) i.e. left most will added 1st and right most will be added last.
      s2 , s1, p1 - p1 and (s2 through it's left part it can be selected )
      p1 , s2, s1 - all can be selected.
      s2, p1, s1 - p1 , s1 and (s2 through its left part it can be selected )
      s1, p1, s2 - p1 and s2 selected.
      p1, s1, s2 - All are selected
      s1, s2, p1 - p1 and (s2 only through its left part )

      I want every line gets selected, once we click on it. Addition sequence of such shaped polyline matters ?
      Is there any way in Qt, through which I can resolve above problem ?

      T Offline
      T Offline
      tushu
      wrote on last edited by tushu
      #2

      @JonB @SGaist @ChrisW67 @jsulm Can you look into this problem ?
      I found useful information : link

      Items are drawn in the order they added to the scene. To move item to the front you can removeItem and then addItem back to the scene
      

      Now I am understanding , why I am able to select the lines which are added last.
      But then, how to access, the items which are added very early ?

      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