Hello all, I am facing a new issue with my drag and drop features inside my treeview, so as it stands you can move tree items to new parents by dragging and dropping which works great.
You drag a tree item (which represents a file on your system) to a new directory and BAM, it moves it in the view and on the file system, life is good and the user is happy. See the treemodel code here: https://gist.github.com/ben-hearn-sb/26215e00827c253792c062ae4b9392ac ...however, and here is the tricky part. I need to allow for users to drag a directory from the windows explorer or Mac finder into the view and drop it into the view (not on a model item). I can do this in the view by setting acceptDrops to true and ovverriding dragEnterEvent and dropEvent. When I reimplement the dragEnterEvent and dropEvent in the view itself, the drag and drop functionality within the model no longer works... files are not moved, nothing happens other than the print statements I have inside the dropEvent in the view class. Is this normal behaviour for the view to override the drop code inside my model? Or should I let the view handle the drop? If the latter, then I would need to find the index of the item dropped to from the view. Here is the shortnened code for my tree model: https://gist.github.com/ben-hearn-sb/a669a25a1f9513207ba3af3f9b801362 If anyone can help me with this I would be very grateful :) Peace! Ben -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/59cc4287-d876-4774-9116-14a9cc2185bcn%40googlegroups.com.
