On Fri, 27 May 2022, 3:54 am Benjam901, <[email protected]> wrote:
> > > 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 > Hey Ben. It's because your overrides for the event handlers are always calling accept() on the event. You need to check the mimetype and if you decide its not something you are going to handle then don't call accept so that the event can propagate. But you should probably also call the super() event handler as well if you want the original view handler code to be able to try default drop behavior. > > 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 > <https://groups.google.com/d/msgid/python_inside_maya/59cc4287-d876-4774-9116-14a9cc2185bcn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPGFgA0091k0JdfHAPfOHyV1gVEfK1sfjp1PuZo3V6v72TCLiA%40mail.gmail.com.
