Modified the mousePressEvent in DragWidget to temporarily detach the dragged QLabel from its parent using setParent(nullptr). This ensures the dragged widget remains visible and above other widgets during the drag operation. Re-parenting logic was added to restore the QLabel to its o riginal container if the drag action is not a MoveAction. This change addresses visual issues where dragged items could disappear behind overlapping widgets, enhancing user experience and maintaining consistent behavior. Task-number: QTBUG-123777 Pick-to: 6.6.2 Change-Id: I3edce9c96815e32eb8f00b61f7eda1709de04b4d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Qt supports native drag and drop on all platforms via an extensible MIME-based system that enables applications to send data to each other in the most appropriate formats. Drag and drop can also be implemented for internal use by applications. Documentation for these examples can be found via the Examples link in the main Qt documentation.