Twice QWidget::event TouchBegin instead one
I wrote an application for raspberry with qt 5.3, raspbian jessie and a 7-inch touch screen.
In my application I need to override the QWidget::event method. And everything was worked ok.
My problems start when I ported my code to raspbian stretch with the qt 5.7.1.
Now my code doesn't work because the QEvent::TouchBegin event is sent twice time.
Do you have any suggestions?
Code
Code:
{
if (e
->type
() == QEvent::TouchBegin) { qDebug("TouchBegin");
.........
return true;
}
if (e
->type
() == QEvent::TouchEnd) { qDebug("TouchEnd");
.....
return true;
}
if (e
->type
() == QEvent::MouseButtonPress) { qDebug("MouseButtonPress");
.....
return true;
}
if (e
->type
() == QEvent::MouseButtonRelease) { qDebug("MouseButtonRelease");
.......
return true;
}
}
Output
TouchBegin
TouchBegin
MouseButtonPresseds
TouchEnd
MouseButtonReleased
Re: Twice QWidget::event TouchBegin instead one
Hard to tell.
Could be a bug in the touch input driver or further up in the stack.
Since you have QtWidgets application my guess is that you are using one of the window system stacks, i.e. X11 or Wayland.
In case of X11 you could try running the "xev" tool and see which events it gets from the X-Server.
Cheers,
_
Re: Twice QWidget::event TouchBegin instead one
thanks for the suggestion, I use linuxfb.
I'll try to investigate about /dev/input/event0
to understand if two events are generated
Bye