If you have drag and drop already working, you have about 95% of what you need already. Your list would send information in the mimeData, and your form would receive that mimeData, and use it to create an instance of the Node widget.
You can see specific examples of what Tim Withers did in his Maya Node Interface. He just uses his own custom mime type, pickles up some data, sends it in the drop, and then the graphics scene reads it and makes a node: Drag: https://github.com/drumboy354/MayaNodeInterface/blob/master/ui/userListModule.py#L34 Drop: https://github.com/drumboy354/MayaNodeInterface/blob/master/ui/graphicsModule.py#L103 You don't have to do it exactly like this. But in Tim's case, he was using a common data structure for a "Node", and would either display that data as a list item, or as a node in the graphics view. It was just a matter of passing over some kind of data. You don't need to pass the actual data if you don't want to. You can even just pass an id or key to your data structure, to allow the receiving side to just look up what it needs. On Fri, Oct 19, 2012 at 10:08 AM, Ali Khanbabaei <[email protected]>wrote: > *i see this example and used in my work a little,but i want a node in my > form,for example when i drag and drop an item from my list to my form , a > new node (my custom widget)Be created in my form.** > * > * > * > > On Friday, October 19, 2012 8:19:33 PM UTC+3:30, Justin Israel wrote: > >> There are a bunch of examples of general PyQt drag and drop out there... >> first google result: >> http://zetcode.com/tutorials/pyqt4/dragdrop/ >> >> If you can explain a little more about what you specifically want to see, >> I can help with an example of that. >> >> >> On Fri, Oct 19, 2012 at 8:46 AM, Ali Khanbabaei <[email protected]>wrote: >> >>> hi >>> with pyqt i want create new widget(my custom widget) with drag and drop >>> event.i want an example about it?for example i want create a new node(my >>> custom widget) with drag and drop (like node editor). >>> -- >>> view archives: http://groups.google.com/group/python_inside_maya >>> change your subscription settings: >>> http://groups.google.com/group/python_inside_maya/subscribe >>> >> >> -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
