Nominate our 2022 Qt Champions!

DragLeaveEvent and file copy

  • Hi,

    I'm developing an app to be able to display files located on an Android device. the App is done in C++ and Qt and must also be able to transfer file between android and my mac osx.

    Currently, I have implemented what is needed to support the drag and drop and I can triggered the DragLeaveEvent.
    When I'm release the left button of the mouse after leaving the app with a file selected to move it from app to the mac osx, a textClipping file is created with the name of the file I want to move.

    Which class need to be subclass to bypass this file create and create my own. MTP provide a copy from android to local storage API but I still not find where to add this API.

    I was thinking the clipboard but not method gave me the piece of code who manage the .textClipping file creation and secondly when moving out of the app, how to get the destination such as "Desktop", or when moving Finder the folder I select.

    The normal behavior works as when dragging a file from the app to the finder, create a file at the location I expect but it's not the right file. The file created is not my file but the .textClipping file which contain the name of my file inside.

    Any idea, where I had to change to support a custom copy API instead of the normal creation of the text clipping file ?

  • For information it's a treewidget and Treewidgetitem used

Log in to reply