开发者

Qt C++ QTouchEvent & TouchPoint Confusion

Just trying to wrap my head around QTouchEvent. Any help/advice is appreciated.

Specifically I'm a bit confused when a touch event is fired (for e.g. TouchBegin); does this represent only one unique touch point? If so why is there a list of touch points inside QTouchEvent?

If not, is it the case that Qt will group together several TouchBegin instances that happen in a given time fraction and deliver it as one event, with the list of points encapsulated in the event? Likewise a QTouchUpdate event will contain information about several touch points that are being updated at that time?

Also I assume that;

QTouchEvent::TouchPoint::id

will remain consistent throughout TouchBegin, TouchUpdate and TouchEnd. Meaning that in different touch events if I see a point with the same id, it is the sam开发者_StackOverflow中文版e touch point that both events are referring to. Is this assumption correct?

FYI: I've been working with TUIO for sometime, so if someone is familiar with both Qt and TUIO a comparative explanation would be much easier for me to understand. I've read through Qt documentation as well, but wasn't able to find an answer to my question.

Still I'd really appreciate any help at all.

Thank you.


How exactly the events are reported seem to differ in different platforms. If you press it with two fingers, it can start with a single touch point (TouchBegin), and immediately follow that with a new QTouchEvent with two TouchUpdate points. But it can also group two touch points into the TouchBegin QTouchEvent. But I have also witnessed two TouchBegin events, event though this is kind of forbidden (see "Touch Point Grouping" in the QTouchEvent doc).

After the begin, there are again differences in the TouchUpdates. Sometimes you always get two points (or the amount you have fingers down) even if you lift one finger. In this case the pressure is 0 for the lifted finger "id". Alternatively you'll get the amount of touchpoint ids that are actually down.

The best way to understand how these are generated is to install an eventfilter and observe the events while you press them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜