paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.92k stars 794 forks source link

Drag and drop flow file #406

Closed yvanblanchard closed 5 months ago

yvanblanchard commented 5 months ago

Hello

I would like to drag and drop a saved flow file for loading it (instead of selecting it from load menu, as for the calculator example). I was able to build the Canvas widget (nodes editor) in a dialog in order to set and enable the drops, but the drop seems to work only for the main dialog (top menus of main dialog) but not for the central canvas widget. Any help?

thank you.

yvanblanchard commented 5 months ago

Problem solved. Just have to set 'setAcceptDrops(true)' in the GraphicsView class constructor, and implement 'dragEnterEvent' (see Qt help/examples for details).