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 drop #262

Merged
merged 5 commits into from
Apr 12, 2024
Merged

Drag drop #262

merged 5 commits into from
Apr 12, 2024

Conversation

SteffenBrinckmann
Copy link
Contributor

Implement drag and drop of external files, which was requested in #12

@@ -314,6 +314,7 @@ def modelChanged(self, item:QStandardItem) -> None:
Args:
item (QStandardItem): item changed, new location
"""
print('start project model changed')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use log.info instead of print, if not needed please remove the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmurugan-fzj Thanks, this was an old debugging message, I forgot to remove. Removed it now

@@ -171,6 +172,61 @@ def tree2Clicked(self) -> None:
return


def dragEnterEvent(self, event:QMouseEvent) -> None:
"""
Overwrite default: what happens if you drag an item
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean "override"? Is this a base class function which is been overridden here in this clasS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


def dropEvent(self, event:QMouseEvent) -> None:
"""
Overwrite default: what happens at end of drag&drop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

elif 'application/x-qstandarditemmodeldatalist' in event.mimeData().formats():
super().dropEvent(event)
else:
print('Drop unknown data', event.mimeData().formats())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use log.warning! or log.error if you need to see the message in console too..!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct

@SteffenBrinckmann SteffenBrinckmann merged commit 5b17285 into main Apr 12, 2024
10 checks passed
@SteffenBrinckmann SteffenBrinckmann deleted the DragDrop branch April 12, 2024 07:01
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

Successfully merging this pull request may close these issues.

2 participants