I am writing a program in Qt where I need to detect when one finger is lifted from the screen while others are still down. I tried to use QEvent::TouchUpdate as such
bool MyClass::event(QEvent *event)
{
switch(event->type())
{
case QEvent::TouchUpdate:
{
if(//some logic to detect if one finger has been lifted)
{
//Change some variables
update();
}
else if(//some logic to detect if finger is being dragged)
{
//Change some variables
update();
}
}
}
return QWidget::event(event);
}
After testing this I found that the everything updates fine, but only once I drag the second finger. I assume this means that removing my finger from the screen while others are down isn't considered an "event" or that it isn't part of TouchUpdate. Am I doing something wrong? Or is there a another way for me to detect this?
Aucun commentaire:
Enregistrer un commentaire