[Python] How to Extract Data from Java Drag-and-Drop into PySide2 Application

Discussão em 'Python' iniciado por Stack, Abril 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Java GUI application with a treeView widget, where drag-and-drop is already enabled. I drag an item from the treeView and try to drop it into another application built using Python and PySide2. This second application has a QTableWidget with the Drop property set to True.

    However, when I drag and drop the item, I don't get the exact text that I expect. Instead, I receive the following data:

    java dataflavor: application/x-java-serialized-object class=com.customPackage.Treeset.CompObjSet


    How can I extract the actual data from this? Is there any way to check if the dropped data contains useful information or if it's in a serializable object format? Any insights on how to handle this ?

    Continue reading...

Compartilhe esta Página