Skip to content

Take the drag mode from the modifiers of the mouse press - #566

Merged
paceholder merged 1 commit into
masterfrom
fix-shift-drag-mode
Nov 29, 2026
Merged

paceholder merged 1 commit into
masterfrom
fix-shift-drag-mode

Conversation

@paceholder

Copy link
Copy Markdown
Owner

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation/refactoring

Description

The view sets RubberBandDrag on a Shift press and ScrollHandDrag on a Shift release. If the view misses the release, for example when another widget has the focus, the rubber band mode stays on. A left drag then selects instead of moving the view, until Shift is pressed and released again.

GraphicsView::mousePressEvent now sets the drag mode from the modifiers of the press. The press always has the right modifiers.

Testing

  • Qt version tested: 6 (offscreen). Qt5 is not tested locally, CI covers it.
  • Existing tests still pass
  • Added tests for new functionality: a mouse press without Shift gives ScrollHandDrag after a Shift press with no release. The test fails without the fix.

The reporter's Linux case is not reproduced. The test covers the stuck mode itself.

Breaking changes?

No.

Related issue

Fixes #363

The view missed the Shift release when another widget had the focus, and the rubber band mode stayed on.

Fixes #363
@paceholder
paceholder merged commit ed53c77 into master Nov 29, 2026
5 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.

Graph drag loses priority to box select after shift depress

1 participant