For context, I'm trying to disable drag-and-drop for an object of type Part::FeaturePython in joint.py.
Thanks,
Gaël
How to disable Drag-And-Drop for a 'Part::FeaturePython' object?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
Re: How to disable Drag-And-Drop for a 'Part::FeaturePython' object?
Do you want to avoid that an object can be dragged, i.e. moved to a container object or avoid that other objects can be dropped on it?
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
Re: How to disable Drag-And-Drop for a 'Part::FeaturePython' object?
I want to disable that another object is dropped on my custom object derived from Part::FeaturePython.
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
Re: How to disable Drag-And-Drop for a 'Part::FeaturePython' object?
Create a canDropObject function in the view provider class that always returns False.
See for example:
https://github.com/FreeCAD/FreeCAD/blob ... w_layer.py
Code: Select all
def canDropObject(self, obj):
return False
https://github.com/FreeCAD/FreeCAD/blob ... w_layer.py