Hi,

I have a QML application and I would like to enable an area to drop there an external file (dragged from Windows explorer, for instance) and show the file path in my application.

I have a really simple test qml to try, but I can not drop anything ("not accepted" cursor is displayed when I enter my DropArea dragging the file).

My code:

Qt Code:
  1. import QtQuick 2.1
  2. import QtQuick.Controls 1.0
  3.  
  4. ApplicationWindow {
  5. title: qsTr("Drop Area test")
  6.  
  7. width: 800
  8. height: 600
  9.  
  10. visible: true
  11.  
  12. DropArea {
  13. id: drop
  14. anchors.fill: parent
  15.  
  16. enabled: true
  17.  
  18. onEntered:
  19. console.log("entered");
  20.  
  21. onExited:
  22. console.log("exited")
  23.  
  24. onDropped:
  25. console.log("dropped")
  26. }
  27.  
  28. Text {
  29. id: textDrop
  30. anchors.centerIn: parent
  31. text: "Drop an element"
  32. }
  33. }
To copy to clipboard, switch view to plain text mode 

I supponse I am doing anything wrong, but I can not fix it...

Thanks in advance,
Diego