Override mouseMoveEvent (or use an event filter) and detach after the user has moved the mouse long enough range. You will receive mouse move events only when mouse button is pressed (unless mouse tracking has been set) so it is enough just to catch mouse movements. If you find it hard to find out the range, you may also catch mouse press events to get the pressing point.
Bookmarks