Factor drag instanciation out into a C++ helper.
This moves the drag source out of the task delegate, making sure it survives the delegate in scenarios where it might be destroyed prior to dropping (e.g. due to a virtual desktop switch), avoiding a crash. I'd like to move this back into QML in Plasma 2 if we can add a programmatic way to initiate a drag to DragArea, or work through some of the event hand- ling issues involved with having a single drag area below the repeater (though this would mean pretty ugly spaghetti code regardless), or QML gains the ability to reparent objects including transferring object ownership (unlikely ...). BUG:323742 This also reduces the number of sub-items the task delegate instanciates and specifically the number of mouse event- handling items per task from two to one, simplifying the scene mouse event filtering that's going on, which appears to address a second rare crash (or at least it has become unreproducable here), although further investigation to prove this conclusively would be nice. BUG:322283
parent
3ff3f433
Please register or sign in to comment