[QScintilla] force copy-action when drag&dropping between two QScintilla widgets

Baz Walter bazwal at ftml.net
Wed Sep 17 21:21:31 BST 2014


On 17/09/14 13:08, Marc Gronle wrote:
> Hi there,
>
> I try to enable a drag&drop-action between to QScintilla widgets but I
> don't want that the text of the source window is deleted if no keyboard
> modifiers are used once the text is dropped onto another text field.
>
> I tried to changed the defaultDropAction in the drop-event of the receiver
> widget, however QSciScinitllabase::dropEvent calls acceptAction (private)
> that calls acceptProposedAction() instead of accept() such that the
> original default action of QDrag::exec is used (MoveAction).
>
> Unfortunately acceptAction is private and cannot be overwritten.
> Is there another possibility to force the source QScintilla instance not to
> delete the text after an arbitrary drag&drop action?
>
> I'm thankful for any suggestion.

One way to change the default drop action in a reimplemented dropEvent 
method, is to reset it on the event object *after* calling the 
base-class dropEvent. Not sure if this is the way it's supposed to be 
done, but it works for me.

-- 
Regards
Baz Walter


More information about the QScintilla mailing list