Skip to content

feat(ui): open files dropped onto the window - #51

Merged
blocksmith314 merged 1 commit into
mainfrom
feature/drag-and-drop
Nov 7, 2026
Merged

blocksmith314 merged 1 commit into
mainfrom
feature/drag-and-drop

Conversation

@blocksmith314

Copy link
Copy Markdown
Owner

Summary

Fixes #24: dropping a local file onto the window opens it.

  • setAcceptDrops(true) on MainWindow
  • dragEnterEvent accepts when the mime data contains a local file URL
  • dropEvent loads the first local file through LoadFile, so drops behave exactly like File > Open (including recent files)
  • MainWindowTest.OpensFileByDrop sends drag-enter/drop events and checks the window title

Verification

  • Build succeeds.
  • ctest: 62/62 tests pass.
  • ./test/tools/tidy.sh mainwindow.cpp mainwindow.h test/test_gui.cpp: 0 issues.

Fixes #24

Accept drops of local files on MainWindow, accept the drag when at least one
local file URL is present, and load the first one through LoadFile, so drops
share the Open dialog path (recent files included).

Adds a GUI test that sends drag-enter and drop events to the window.
@blocksmith314
blocksmith314 merged commit 92c7e4b into main Nov 7, 2026
2 of 3 checks passed
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.

Open files by drag and drop onto the window

1 participant