Home > Mobile >  O: touch screen scroll up and down control, the control response to the click event. For such a solu
O: touch screen scroll up and down control, the control response to the click event. For such a solu

Time:12-02

 QT5 touch screen to realize mousemove instead of wheel events, the sliding scroolarea area for display, at the same time realize scroolarea internal control response to the click event,

Plan 1:
Pushbutton + scroolarea
Problem: 1. The mousemove instead of roller event not to be: mousemove, as it passed the pushbutton does not respond, setMouseTracking (true),


Scheme 2:
Lable + scroolarea
Question:
1. Rewrite mousmove events, judge whether the point of the click inside lable, thus click event determine,
But scroolarea lable control cannot get right below the position of the click event, has always been at the top of the lable control click event response,
Cutting, slide up and down trigger click and slide two events at the same time,

Now have no idea, so please the great god give directions, give a way of thinking,
Thank you very much

CodePudding user response:

Touch screen should use QTouchEvent
The Qt: : open WA_AcceptTouchEvents attribute
When using QAbstractScrollArea -based widgets, you should enable the Qt: : WA_AcceptTouchEvents attribute on the scroll area 's viewport.

CodePudding user response:

Pushbutton oneself use QWidget implementation, mousemove triggers the click event, not trigger scroolarea sliding, directly after the press release for the trigger button click event

CodePudding user response:

Qt has special processing of touch, positive solution on the second floor
  •  Tags:  
  • Qt
  • Related