Mouse selection handler ?

I want to create something like a selecting in desktop/files , when you go to your desktop and click left button and drag it you can see a blue selecting " in windows at least " that you can select things using it..

I want something like that , when the user clicks a button the mouse acts like it acts in files and select things and then return the coordinates or a graph view.

Basically you know the tool called snipping tool in windows ? you know when you click the button it renders a thing that lets you select what you want ? that's what I want.

can you direct me to a class or something that gives function that does the same job ?

I don't think you can control mouse events if they are outside of your application.
If you need to grab a region of a screen then open a transparent borderless widget on a whole screen to pickup mouse events on the desktop.

Thanks for answering , I didn't put the parent in the QtRubberband and it's working outside except I need my widget to me showing on the screen " not minimize " + I only can control top left area of my screen since the button that shows the rubber band is on top left.

how could I use transparent borderless widget ? I'm using qt widget...