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

Fix drag & drop on Windows for mrview #2886

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Conversation

daljit46
Copy link
Member

Should address #1373

Copy link
Member

@Lestropie Lestropie left a comment

Choose a reason for hiding this comment

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

Confirmed resolves issue on my Windows machine. But only for specifically dragging & dropping main images. There are also toolbars where a user may attempt to drag & drop a file, which this changeset currently won't resolve. Would suggest functionalising the decoding of filesystem paths from a drop event, and make use of it across those multiple contexts:

  • Overlay tool
  • Connectome tool
  • Fixel plot
  • Tractography tool
  • ROI editor

Note that the ODF display tool is intentionally omitted from this list: this is because the type of ODF cannot be reliably inferred from just the input image data alone, and so the user is forced to nominate the type of ODF by clocking on the corresponding button.

@daljit46
Copy link
Member Author

To address your comment, I've now introduced a new MR::GUI::MRView::QtHelpers namespace which contains a url_to_std_string helper function that is used when handling drop events.
One thing I'm not sure is where should qthelpers.h should reside. Currently, it's in src/gui/mrview but perhaps it makes more sense in src/gui?

Copy link

clang-tidy review says "All clean, LGTM! 👍"

@daljit46 daljit46 force-pushed the fix_drag_drop_mrview_windows branch from 5f05d13 to 4ae723f Compare May 30, 2024 15:58
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/gui/mrview/qthelpers.cpp Outdated Show resolved Hide resolved
@daljit46 daljit46 force-pushed the fix_drag_drop_mrview_windows branch 2 times, most recently from 3b70261 to 7135b36 Compare May 31, 2024 14:11
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@daljit46 daljit46 requested a review from Lestropie July 11, 2024 14:24
@Lestropie
Copy link
Member

  • Tried to test, but for some reason libmrtrix-gui.dll was not built. Fresh build directory, QT5. Will continue trying.
  • I think that this would be better targeted at master rather than dev given that it is a bug fix.

Copy link
Member

@Lestropie Lestropie left a comment

Choose a reason for hiding this comment

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

Fixed non-compilation by bringing up to date with dev.

Tested drag & drop on the listed toolbars.

Do maintain this should be back-propagated to master. But given the code formatting changes would cause conflicts across the board, could maybe merge this, manually re-implement on master, and then on dev accept only the dev-based change?

Copy link

clang-tidy review says "All clean, LGTM! 👍"

@daljit46
Copy link
Member Author

Do maintain this should be back-propagated to master. But given the code formatting changes would cause conflicts across the board, could maybe merge this, manually re-implement on master, and then on dev accept only the dev-based change?

Sounds good to me.

A new QtHelpers namespace has been introduced which contains a helper
function to convert a QUrl to a std::string, ensuring that local URLs
are parsed correctly on all platforms.
@daljit46 daljit46 force-pushed the fix_drag_drop_mrview_windows branch from 0004afe to 1f2656d Compare August 15, 2024 13:45
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@daljit46 daljit46 merged commit d9ddbd4 into dev Aug 28, 2024
6 checks passed
@daljit46 daljit46 deleted the fix_drag_drop_mrview_windows branch August 28, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants