Multi Touch problem on Symbian^3



  • Hi there,

    I'm developing a game for Symbian using Qt & its Graphics View framework.
    Here's my piece of code on event handling :
    (blue & red are two balls using QGraphicsPixmapItem
    @ case QEvent::TouchBegin:
    case QEvent::TouchUpdate:
    case QEvent::TouchEnd:
    {
    QTouchEvent te = static_cast<QTouchEvent>(event);
    QListQTouchEvent::TouchPoint points = te->touchPoints();
    for(int i = 0;i < points.size();i++)
    {
    if(blue->pos().x()-5 < points[i].lastPos().x() && points[i].lastPos().x() < blue->pos().x()+57
    && blue->pos().y()-5 < points[i].lastPos().y() && points[i].lastPos().y() < blue->pos().y()+57
    && points[i].lastPos().x() != 0 && points[i].lastPos().y() != 0)
    {
    blue->setPos(points[i].pos().x(),points[i].pos().y());
    }
    if(red->pos().x()-5 < points[i].lastPos().x() && points[i].lastPos().x() < red->pos().x()+57
    && red->pos().y()-5 < points[i].lastPos().y() && points[i].lastPos().y() < red->pos().y()+57
    && points[i].lastPos().x() != 0 && points[i].lastPos().y() != 0)
    {
    red->setPos(points[i].pos().x(),points[i].pos().y());
    }
    }
    break;
    } @
    I know that the code is not optimized at all and On my device Nokia C7-00 when both balls are moving using this event the second one lags a lot! What should I do???

    Thanks in advance.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.