Multitouch support on avogadro

Hi,

I’ve spent some days now trying to add support for multitouch on Avogadro. I’ve guide myself using the model you have constructed for drawtool (the mouse and key events), but without success. In the last version I add in drawtool.h :

virtual QUndoCommand* event(GLWidget *widget, QTouchEvent *event);

and in drawtool.cpp

// QUndoCommand* DrawTool::event(GLWidget *widget,QTouchEvent *event)
// {
//qDebug<< “touch event”;
// QUndoCommand *undo = 0;
// switch (event->type())
//{
//case QEvent::TouchBegin:
//{
//emit message(“Touch Begin”);
//break;
//}
//case QEvent::TouchUpdate:
//{
//emit message(“Touch Update”);
//break;
//}
//case QEvent::TouchEnd:
//{
//emit message(“Touch End”);
//break;
//}

////default:
////return QWidget::event(event);
// }

// return undo;

// }

but is not working since I don’t know how to set Qt::WA_AcceptTouchEvents attribute for the GLWidget send like parameter in my function.
I really appreciate an advice from you part, since I’m blocked…

Thank you very much!

Gina

On Oct 6, 2011, at 4:03 AM, Elena-Gina CRACIUN wrote:

I’ve spent some days now trying to add support for multitouch on Avogadro. I’ve guide myself using the model you have constructed for drawtool (the mouse and key events), but without success. In the last version I add in drawtool.h :

The mouse events are sent from GLWidget to the tools – so you can add the events to the Tool classes, but they’ll never get them because GLWidget isn’t forwarding them. Here’s an example which implements the double-click event:
http://review.source.kitware.com/#patch,sidebyside,2552,

So you’d need to add the various touch events to glwidget.h and glwidget.cpp to send to the different tools first.

Hope that helps,
-Geoff

Thank you Geoff.
Now I have a point from where to start :).

Regards,
Gina


I’ve spent some days now trying to add support for multitouch on Avogadro. I’ve guide myself using the model you have constructed for drawtool (the mouse and key events), but without success. In the last version I add in drawtool.h :

The mouse events are sent from GLWidget to the tools – so you can add the events to the Tool classes, but they’ll never get them because GLWidget isn’t forwarding them. Here’s an example which implements the double-click event:
http://review.source.kitware.com/#patch,sidebyside,2552,

So you’d need to add the various touch events to glwidget.h and glwidget.cpp to send to the different tools first.

Hope that helps,
-Geoff