This element is intended to be used as "click on empty areas
to dismiss" use case.
a MouseArea or a TapHandler are not enough for this, because Flickables
eat mouse events even tough no dragging would happen
this filters explicitly events of flickables to emit clicks when no drag
happened on them
Details
Details
- Reviewers
davidedmundson - Group Reviewers
Plasma - Commits
- R296:e634bda6331c: introduce FallbackTapHandler
have a listview as child of the FallbackTapHandler and delegates with
a mousearea. The handler will emit tapped only when the user taps on an empty area
of the listview, but not on tap of its delegates
Diff Detail
Diff Detail
- Repository
- R296 KDeclarative
- Branch
- phab/fallbacktaphandler
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 14632 Build 14650: arc lint + arc unit
src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp | ||
---|---|---|
71 ↗ | (On Diff #62868) | You're clearing before doing the tap evaluation which uses this |
77 ↗ | (On Diff #62868) | I don't follow this line. Should it be < startDragDistance? |
src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.h | ||
49 ↗ | (On Diff #62868) | We need to update setAcceptedMouseButtons(Qt::LeftButton); when this changes |
src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp | ||
---|---|---|
50 | m_buttons = buttons or change the getter for acceptedButtons to call QQuickItem::acceptedMouseButtons |