Propagate unused mouse wheel events in edit tools
ClosedPublic

Authored by muhlenpfordt on Jul 23 2018, 7:58 AM.

Details

Summary

If an edit tool like Crop or Red Eye Reduction is active, zooming
and panning by mouse wheel does not work. This is caused by the
QEvent::accepted flag set to true by default and therefore not
propagating the event.
This patch clears the accepted flag for mouse wheel events until
a subclass of AbstractRasterImageViewTool will accept wheel events
by itself.

FIXED-IN: 18.08.0

Test Plan
  1. Open Gwenview in View Mode
  2. Enter Crop or Red Eye Reduction tool
  3. Check if Ctrl+wheel zooming works
  4. Check if panning with wheel/Alt+wheel works

Diff Detail

Repository
R260 Gwenview
Branch
tool-zoom-by-wheel (branched from Applications/18.08)
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 1073
Build 1086: arc lint + arc unit
muhlenpfordt requested review of this revision.Jul 23 2018, 7:58 AM
muhlenpfordt created this revision.
muhlenpfordt edited the summary of this revision. (Show Details)Jul 23 2018, 3:06 PM
muhlenpfordt edited the test plan for this revision. (Show Details)
rkflx accepted this revision.Jul 23 2018, 11:59 PM
rkflx added a subscriber: rkflx.

LGTM, works great!

I guess the issue is partly caused by all of the boilerplate like RasterImageView::wheelEvent, because removing that function completely would also solve it. But just in case a new tool would need to overwrite this behaviour, we probably should keep that function.

Making Ctrl-right/left click and middle click work for tools too (where it makes sense) is not that easy, is it?

This revision is now accepted and ready to land.Jul 23 2018, 11:59 PM

Making Ctrl-right/left click and middle click work for tools too (where it makes sense) is not that easy, is it?

It needs a bit more differentiation inside the crop/redeye event handlers but it should be no problem.

This revision was automatically updated to reflect the committed changes.