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

Drag and Drop #39

Open
jamesdbrock opened this issue Sep 15, 2023 · 3 comments
Open

Drag and Drop #39

jamesdbrock opened this issue Sep 15, 2023 · 3 comments

Comments

@jamesdbrock
Copy link
Member

https://doc.qt.io/qtforpython-6/overviews/dnd.html#drag-and-drop

https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QWidget.html#PySide6.QtWidgets.PySide6.QtWidgets.QWidget.acceptDrops

I think the best way to support this would be to add an on_drop prop to the View.

class View(_LinearView):

 def __init__(self, layout: tp.Text = "column", on_drop: tp.Optional[tp.Callable[[QDropEvent], tp.Any]], **kwargs): 

Then we can put a View around any region which we want to be droppable.

Maybe we also need the other events, QDragEnterEvent, QDragMoveEvent, QDragLeaveEvent.

@jamesdbrock
Copy link
Member Author

We have drop events in #83

@sachitotakahashi-vienna

Maybe we also need the other events, QDragEnterEvent, QDragMoveEvent, QDragLeaveEvent.

Maybe they are luxury at first. :-)

@jamesdbrock
Copy link
Member Author

Maybe we also need the other events, QDragEnterEvent, QDragMoveEvent, QDragLeaveEvent.

Maybe they are luxury at first. :-)

We have all those drop-related events now, the new docs will look like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants