Visual way for item selection

  • Hello,

    I want to draw a blue rectangle (in any form, qgraphicsitem for example) and being able to select/show selection on a part of it by painting the selected zone in another color, lets say yellow.
    I can retrieve the selection width by different methods (for example with drag/drop or by press/release by saving the coordinates values of these events).
    However, I need a "visual" way to show the selected zone, how do you think I could achieve that?
    The ugly way would probably be to draw another yellow rectangle on top of the blue rectangle and to update its width with events and update();
    However, I would like to do it a cleaner way, if possible.


  • Lifetime Qt Champion


    Are you thinking about something like QRubberBand ?

  • This looks really really nice cant way to implement it !
    Thank you very much SGaist ;)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.