Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to force the drop action to be copyaction when the drop location is some other application?



  • Hello, I have subclassed QMimeData and drag&drop works perfectly fine within my widget - for both copyAction and MoveAction. Data gets copied and moved as needed (based on shift / ctrl keys etc.)

    For compatibility I am supporting other simple formats such as text/plain - the major problem is, I cannot allow 'move' operation for the drops to other applications for these compatible formats.

    For example, I allow my data to be dropped from my widget to some textbox - but only as long as it is a 'copyAction'. But, I do not see any way of forcing this.

    How to force the drop action to be 'copy action' for external widgets, while allowing the copy/move within my widget?????

    After all, I cannot _delete _ my data just because they exported it in some compatible format to some text box..ah...


Log in to reply