Search code examples
c++qtgraphicsselectionarea

Selection area in Qt widget


I have a problem with selection area.

If you click on your windows desktop, and drag mouse, you will see selection area. I'm trying to achieve generally similar thing.

Do you have any ideas how to achieve this?


Solution

  • It is called "rubber band". You need to find an example for using QRubberBand class. I cannot separate a small sample from relatively big project but overall it is not very complex and simply works.