android - Qt TouchBegin touchPoint.pos() is stuck at 0,0 -
After
I'm coding when an Android app and TouchEvent in my QT emits touchEvent-> gt; (NewPoint) on contact sources () .pos () is always 0,0 as long as I take it in my finger and force the touch update event. Is there a way to get status on TouchBegin? Below is my event code:
bool event (QEvent * e) {switch (e> type ()) {Case: QEvent :: TouchBegin: touchEvent = static_cast & lt; QTouchEvent * & gt; (E); Touch touch (); Touch update (); Back true; Case QEvent :: TouchUpdate: touchEvent = static_cast & lt; QTouchEvent * & gt; (E); Touch update (); Back true; Case QEvent :: TouchEnd: touching touch (end); Back true; Default: Return QWidget :: event (e); }}
OK, I solved it. I was using the touchEvent.touchPoints (global position) when I needed to use it. (CurrentPoint) .pos () X () or .y () and if it was in a frame or widget i need to get global position from that point
Comments
Post a Comment