PDA

View Full Version : How to set QTouchEvent::TouchPoint primary?



elindros
9th February 2011, 11:12
Hi to everybody,

I'm trying to simulate QTouchEvents by creating myself TouchPoints. I was wondering how I can set them primary, since isPrimary() exists, but setPrimary() does not exist.

isPrimary() is not even virtual so I think I cannot try to subclass the TouchPoint class and reimplement it.

I was also wondering why the QTouchEvent::TouchPoint constructors are not published in the docs (http://doc.qt.nokia.com/4.7/qtouchevent-touchpoint.html) also if they exist.



/usr/include/qt4/QtGui/qevent.h:739: note: candidates are: QTouchEvent::TouchPoint::TouchPoint(const QTouchEvent::TouchPoint&)
/usr/include/qt4/QtGui/qevent.h:738: note: QTouchEvent::TouchPoint::TouchPoint(int)


Has anybody any idea?

Thanks in advance.

Elindros

nicokruithof
21st January 2013, 20:20
It is encoded in the state:


event.setState(Qt::TouchPointPrimary)