Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
None
-
Windows
-
6f65ddbc217a8c82b091d31e88faf3dc23baa13b (qtbase/dev, 23.10.2015, 5.7)
Description
It would be nice to have means to programmatically cancel the drag and drop action on Windows. Now it is only possible to do in Windows specified way by pressing Esc key.
Use case: Cancel touch initiated drags when user taps 2nd finger to do a gesture.
The suggestion is to implement QGuiApplication::cancelDragDrop(), which triggers a flag denoting the cancellation. And then the flag will be checked in QWindowsOleDropSource::QueryContinueDrag() function, for example, in the following way:
QGuiApplication::processEvents(); // now that we are in a dragevent loop, we need to query our application if the operation needs to be canceled. if (QGuiApplication::dragDropCancelled) { // will autoreset! hr = ResultFromScode(DRAGDROP_S_CANCEL); break; }