<div dir="ltr"><div><div><div><div><div>Ok, the way proposed by Baz Walter works for me as well. If I change the default drop action before calling the base-class dropEvent, the default will be replaced by the previous default (set in QSciScintillaQt::StartDrag in the call qdrag->exec(...)) since the drop action is not accepted using *accept()* but using *acceptProposedAction()*. <br><br></div>In my case it is more the source widget that should control whether its content can be moved, copied or both and not the receiver. In the case described above (the case which works now), the implementation is done in the dropEvent of the receiver, that needs to check if the action should be switched to a copy action depending on the type of source widget. Maybe it would also be nice to being able to change the default action in the startDrag method.<br><br></div>For instance, if the source widget is read-only and text is dragged into another widget, a move action is used as default and the dropped text is finally deleted from the source widget. I think this is not desired. So maybe there is a good solution to control this.<br><br></div>Thanks for your answers<br><br></div>Cheers<br>Marc<br>--------------------------------------------------------<br></div><div>Institut für Technische Optik<br></div><div>Universität Stuttgart<br></div><a href="http://itom.bitbucket.org">http://itom.bitbucket.org</a><br>--------------------------------------------------------<br><div><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-17 22:21 GMT+02:00 Baz Walter <span dir="ltr"><<a href="mailto:bazwal@ftml.net" target="_blank">bazwal@ftml.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 17/09/14 13:08, Marc Gronle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi there,<br>
<br>
I try to enable a drag&drop-action between to QScintilla widgets but I<br>
don't want that the text of the source window is deleted if no keyboard<br>
modifiers are used once the text is dropped onto another text field.<br>
<br>
I tried to changed the defaultDropAction in the drop-event of the receiver<br>
widget, however QSciScinitllabase::dropEvent calls acceptAction (private)<br>
that calls acceptProposedAction() instead of accept() such that the<br>
original default action of QDrag::exec is used (MoveAction).<br>
<br>
Unfortunately acceptAction is private and cannot be overwritten.<br>
Is there another possibility to force the source QScintilla instance not to<br>
delete the text after an arbitrary drag&drop action?<br>
<br>
I'm thankful for any suggestion.<br>
</blockquote>
<br></div></div>
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.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Regards<br>
Baz Walter</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
QScintilla mailing list<br>
<a href="mailto:QScintilla@riverbankcomputing.com" target="_blank">QScintilla@riverbankcomputing.<u></u>com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/qscintilla" target="_blank">http://www.riverbankcomputing.<u></u>com/mailman/listinfo/<u></u>qscintilla</a><br>
</div></div></blockquote></div><br><br clear="all"><br>
</div></div></div></div></div></div></div></div></div>