

def dropEvent(self, e):
    ' Handles a Python object being dropped on the tree.\n        '
    editor = self.parent()._qt4_editor
    klass = editor.factory.klass
    if editor.factory.binding:
        value = getattr(clipboard, 'node', None)
    else:
        value = e.mimeData().instance()
    if ((klass is None) or isinstance(value, klass)):
        editor._no_update = True
        try:
            if hasattr(value, 'drop_editor_value'):
                editor.value = value.drop_editor_value()
            else:
                klass.value = value
            if hasattr(value, 'drop_editor_update'):
                value.drop_editor_update(self)
            else:
                self.setText(editor.str_value)
        finally:
            editor._no_update = False
        e.acceptProposedAction()

dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/drop_editor.py _DropEventFilter.dropEvent/VarMisuse@123/169 `editor`->`klass`