You should just be able to "take" an item from the model and then add it to the new location. Does that approach not work for you? I don't recall needing to clone the item and delete the old one.
On Thu, Mar 12, 2015 at 10:00 AM Joe Weidenbach <[email protected]> wrote: > Hey folks, > > More of a conceptual question here, as I've got this working at this > point, but it feels like I had to do some ugly workarounds, which I can > design around in the future, but would rather not have to. > > As I'm understanding it, Qt's Drag and Drop functionality in Models and > Views is based on primarily taking elements from one model and moving them > to another. When I am working in a Tree View, for example, and I want to > reorder or reparent items, I basically have to clone my item that I'm > dropping and put it in the model where I want it, after which Qt deletes > the original. This makes sense based on the usual use of drag and drop to > go from one view to another. > > The question is, is there a way to set things up so I can just move an > item? It's easy enough to build a data model that supports serializing and > then making a new item that is a duplicate of the old, but it seems like > extra work (both on the coding and on the processing sides) as compared to > just changing the parent or sort index. > > Just curious. > > Thanks, > > Joe > > -- > 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/CAM33%3Da4_R8YYmG_BOG0nnh%2BHGVQrWhvbrFTCM%2BOjoWmxHx4W_A%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da4_R8YYmG_BOG0nnh%2BHGVQrWhvbrFTCM%2BOjoWmxHx4W_A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAPGFgA23n7vsBRaUasH8w9%2B0Jdmma%2BNAvusFFgokA68rxCGFbA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
