1
我在QT中編寫了一個Android應用程序,並且當TouchEvent發射時,我的touchEvent-> touchPoints()。at(newPoint).pos()始終爲0, 0直到我移動手指並強制觸摸更新事件。有沒有辦法獲得TouchBegin的位置?以下是我的活動代碼:Qt TouchBegin touchPoint.pos()停留在0,0
bool event(QEvent* e)
{
switch(e->type())
{
case QEvent::TouchBegin:
touchEvent = static_cast<QTouchEvent*>(e);
emit touchBegin();
emit touchUpdate();
return true;
case QEvent::TouchUpdate:
touchEvent = static_cast<QTouchEvent*>(e);
emit touchUpdate();
return true;
case QEvent::TouchEnd:
emit touchEnd();
return true;
default:
return QWidget::event(e);
}
}