fix: Fix the touch screen vertical swipe dragging issue#259
Merged
Conversation
Fix the touch screen vertical swipe dragging issue Log: Fix the touch screen vertical swipe dragging issue pms: BUG-351197
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds gesture handling to the clipboard ListView so that drag-ready state is reset when touch gestures finish or are canceled, fixing vertical swipe drag issues, and updates SPDX copyright years. Sequence diagram for handling gesture events to reset drag statesequenceDiagram
participant QScroller
participant TouchScreen
participant QtEventLoop
participant ListView
participant QListView
TouchScreen->>QtEventLoop: QEvent_Gesture
QtEventLoop->>ListView: event(QEvent_pointer)
activate ListView
ListView->>ListView: check event->type() == QEvent_Gesture
ListView->>ListView: gestureEvent = static_cast_QGestureEvent(event)
loop for each gesture in gestureEvent->gestures()
ListView->>ListView: check gesture->state()
alt GestureFinished_or_GestureCanceled
ListView->>ListView: resetReadyDragState()
end
end
ListView->>QListView: QListView::event(event)
deactivate ListView
QListView-->>QtEventLoop: bool handled
QtEventLoop-->>TouchScreen: update scrolling/dragging state
Updated class diagram for ListView gesture handlingclassDiagram
class QListView {
<<QtWidget>>
+event(QEvent_pointer) bool
+mousePressEvent(QMouseEvent_pointer) void
+mouseMoveEvent(QMouseEvent_pointer) void
+mouseReleaseEvent(QMouseEvent_pointer) void
+mouseDoubleClickEvent(QMouseEvent_pointer) void
+changeEvent(QEvent_pointer) void
}
class ListView {
+ListView(QWidget_pointer parent)
+event(QEvent_pointer) bool
+mousePressEvent(QMouseEvent_pointer) void
+mouseMoveEvent(QMouseEvent_pointer) void
+mouseReleaseEvent(QMouseEvent_pointer) void
+mouseDoubleClickEvent(QMouseEvent_pointer) void
+changeEvent(QEvent_pointer) void
-resetReadyDragState() void
}
class QEvent {
+type() QEvent_Type
}
class QGestureEvent {
+gestures() QList_QGesture_pointer
}
class QGesture {
+state() Qt_GestureState
}
ListView --|> QListView
ListView ..> QEvent : overrides_event
ListView ..> QGestureEvent : casts_to
ListView ..> QGesture : iterates_gestures
QGestureEvent ..> QGesture : contains
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider restricting the reset logic to specific gesture types (e.g., swipe or pan) instead of all gestures, to avoid unintentionally cancelling drags in response to unrelated gestures like taps or pinch-zooms.
- You might want to short-circuit the event handling (e.g., return true) once you’ve handled a finished/canceled gesture, if you don’t want the base QListView::event to perform additional gesture-related processing that could interfere with the drag state.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider restricting the reset logic to specific gesture types (e.g., swipe or pan) instead of all gestures, to avoid unintentionally cancelling drags in response to unrelated gestures like taps or pinch-zooms.
- You might want to short-circuit the event handling (e.g., return true) once you’ve handled a finished/canceled gesture, if you don’t want the base QListView::event to perform additional gesture-related processing that could interfere with the drag state.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
18202781743
approved these changes
Mar 23, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the touch screen vertical swipe dragging issue
Log: Fix the touch screen vertical swipe dragging issue
pms: BUG-351197
Summary by Sourcery
Handle touch gesture completion in the clipboard list view to resolve incorrect drag state after vertical swipe on touch screens.
Bug Fixes:
Enhancements: