Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small drag & drop fixes #6163

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
1.4.15.x (relative to 1.4.15.2)
========

Fixes
-----

- GraphEditor : Fixed errors when dragging an unknown file type into the GraphEditor.
- Widget : Fixed `event.sourceWidget` for DragDropEvents generated from a Qt native drag within the same Gaffer process. This will now reference the `GafferUI.Widget` that the Qt source widget belongs to, if any.

1.4.15.2 (relative to 1.4.15.1)
========
Expand Down
6 changes: 5 additions & 1 deletion python/GafferUI/Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,13 @@ def __foreignDragEnter( self, qObject, qEvent ) :
Widget._modifiers( qEvent.keyboardModifiers() ),
)
dragDropEvent.data = data
dragDropEvent.sourceWidget = None
dragDropEvent.destinationWidget = None

if isinstance( qEvent.source(), QtWidgets.QWidget ) :
dragDropEvent.sourceWidget = GafferUI.Widget._owner( qEvent.source() )
else :
dragDropEvent.sourceWidget = None

if widget._dragEnterSignal( widget, dragDropEvent ) :
qEvent.acceptProposedAction()
self.__foreignDragDropEvent = dragDropEvent
Expand Down
3 changes: 2 additions & 1 deletion startup/gui/graphEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ def __dropLocationData( event ) :
if (
not isinstance( event.data, IECore.StringVectorData ) or
len( event.data ) != 1 or
not event.data[0].startswith( "/" )
not event.data[0].startswith( "/" ) or
event.sourceWidget is None
) :
return None

Expand Down