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 
> <javascript:>> 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/8vxb3h9n
>>>
>>> So 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_maya+unsubscr...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/9f589df1-9e59-413f-8a81-8c845b44503e%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/9f589df1-9e59-413f-8a81-8c845b44503e%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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/dd59e09d-c61f-44b7-b437-5653cace55ff%40googlegroups.com.

Reply via email to