Reputation: 1
I am having an issue with QT touch/multitouch support under Windows 8 running on an Acer W501 x86 tablet with a 4-point touch screen.
I have a QGraphicsView widget on which I've done
setAttribute(Qt::WA_AcceptTouchEvents);
The widget's parent has an eventFilter method:
bool MyGUI::eventFilter(QObject* pObject, QEvent* pEvent)
{
QEvent::Type eType = pEvent->type();
if (pObject == _uiWindow._multitouchArea)
{
if ((eType == QEvent::TouchBegin) || (eType == QEvent::TouchEnd) || (eType == QEvent::TouchUpdate))
{
// invoke multi touch event handling here
_handleTouchEvent(pEvent);
}
else if ((eType == QEvent::MouseButtonPress) || (eType == QEvent::MouseButtonRelease) || (eType == QEvent::MouseMove))
{
// invoke mouse based handling here
_handleMouseEvent(pEvent);
}
}
else
{
return pObject->event(pEvent);
}
return false;
}
which is installed on the QGraphicsViewWidget.
Now I understand that Qt by default interprets single point touch events as mouse events and sends them to the application like that. However, I've been unable to trigger any TouchBegin/TouchUpdate/TouchEnd events whatsoever no matter how hard I mash the touch screen with any part(s) of my anatomy...
Is there something that I am missing here?
Thank you all!
Upvotes: 0
Views: 1136
Reputation: 1997
Did you try installing the event filter on the viewport() of the graphicsview? This is where the events are sent.
Upvotes: 1