how to separate scrolling and touch events in a layout with tableview on touch screen.
-
Qml file structure is as follows:
GroupBox { id: root title: "" label: Label { text: root.title } Flickable { id: flickable TableView { ......... ScrollBar.vertical: VerticalScrollBar { id: scrollBar anchors.right: parent.right } } } MouseArea { id: mouseArea anchors.fill: parent propagateComposedEvents: true onPressed: { console.log("Touch pressed at:", mouse.x, mouse.y); } onClicked: { console.log("Touch clicked at:", mouse.x, mouse.y); } } }
MouseArea is added to get touch events to pop-up another item. If mousearea is added, scrolling for TableView will not work. How to use pressed or clicked event without affecting scrolling in TableView. No help with higher z value in either tableview or mousearea.
No issues if mouse is used. Scrolling in tableview is blocked only by touch on touch screen.
Any help will be appreciated.
OS: Yocto
Qt: 5.15.13 -
You are using the TableView from Controls 1. You can solve this by defining rowDelegate & defining the MouseArea responses.
Scrolling works as is. No need to define flickable as well.
e.gTableView { rowDelegate: Rectangle { id : rowDelegate height: 100 MouseArea { } } }
-
You are using the TableView from Controls 1. You can solve this by defining rowDelegate & defining the MouseArea responses.
Scrolling works as is. No need to define flickable as well.
e.gTableView { rowDelegate: Rectangle { id : rowDelegate height: 100 MouseArea { } } }
@dheerendra Thank you for your reply. I do not use TableView from Controls 1. Instead, TableView: QtQuick is applied. Flickable is not the issue. Touch event handling in Qml is the problem. Mouse works just fine.