I am not in front of a computer right now, but I thought the itemview's viewport() was what handled drag/drop events. Have you tried installing an event filter on the view that handles drop events for the viewport?
On Thursday, February 13, 2020 at 8:44:49 PM UTC-8, Dilen Shah wrote:Hey Justin,Sorry about the confusion, looks like i pasted the wrong code.This is what i wanted to paste: https://pastebin.com/8vxb3h9nSo my only issue currently is that when i move/re-order QTreeWidget i am not getting any prints from the dropEvent or dragEnterEvent.Can't seem to figure it out why it's not firing. Currently i am only looking to make the re-order event work.Hope this makes sense.Thanks.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9f589df1-9e59-413f-8a81-8c845b44503e%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Hey guys,So i have managed to get it working using installEventFilter.So now when i change the order i get the event and i can run some information in it.Just out of curiosity is there a simpler way using installEventFilter to get the original row index of item before dragEnter and index after drop?
Thanks,Dilen.
On Monday, February 17, 2020 at 2:18:20 PM UTC+10:30, Dilen Shah wrote:
Hey Russell and Justin,Thank you for your replies. I will test the installEventFilter() and see how i can implement it and if i cant figure it out might put out my code again.Thanks,Dilen.
On Saturday, February 15, 2020 at 12:32:44 PM UTC+10:30, Justin Israel wrote:
On Sat, Feb 15, 2020, 10:40 AM Russell Pearsall <robo...@gmail.com> wrote:I am not in front of a computer right now, but I thought the itemview's viewport() was what handled drag/drop events. Have you tried installing an event filter on the view that handles drop events for the viewport?To expand on this, the original code isn't working as expected because it is just implementing drag and drop methods on the main window. There isn't a connection between the main window drag drop and the child tree view, unless the tree view decides to not handle the event and it manages to bubble up to the main window as a parent.So using installEventFilter() on the tree viewport and catching them in the eventFilter method on the main window is one approach.Or you can create a QTreeWidget subclass in your code and reimplement the drag drop handling in there so it is isolated from the main window logic. Up to you.
--
On Thursday, February 13, 2020 at 8:44:49 PM UTC-8, Dilen Shah wrote:Hey Justin,Sorry about the confusion, looks like i pasted the wrong code.This is what i wanted to paste: https://pastebin.com/8vxb3h9nSo my only issue currently is that when i move/re-order QTreeWidget i am not getting any prints from the dropEvent or dragEnterEvent.Can't seem to figure it out why it's not firing. Currently i am only looking to make the re-order event work.Hope this makes sense.Thanks.
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9f589df1-9e59-413f-8a81-8c845b44503e%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d1461bb6-46d1-4f44-b234-0c2d620b2081%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9f589df1-9e59-413f-8a81-8c845b44503e%40googlegroups.com.
--
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 python_inside_maya+unsub...@googlegroups.com.