
press release
replay events

press move little release
replay events

press move lot release
gesture

press move lot release press move lot release
gesture

press move lot release press release
gesture

[23:35] <lbt> rohanpm: tell me more :)
[23:36] <lbt> I'm doing this http://pastebin.com/d359cf665
[23:36] <rohanpm> lbt: well, say you have a QPaintEvent* pe, and you do QEvent e = *pe;  Then you will lose all QPaintEvent-specific data
[23:37] <lbt> I'm intercepting eventFilter, recording the ev and playing it back later
[23:37] <lbt> I expected polymorphism(?) to work 
[23:38] <rohanpm> Polymorphism does work
[23:38] <lbt> good, I've not broken that then ;)
[23:38] <rohanpm> search for "slicing C++"
[23:38] <lbt> OK, I'll do that - ta
[23:40] <lbt> mmmm so that means I can't implement a QQueue<QEvent>
[23:40] <lbt> without watching the assigment of each one...
[23:41] <rohanpm> Not in a meaningful way, no
[23:41] <lbt> ouch
[23:41] <rohanpm> You can have a container with QEvent* though
[23:41] <lbt> yes but the object I hold ref to may be deleted
[23:41] <lbt> it's not 'mine'
[23:41] <rohanpm> Yes, you'll still need to make a copy
[23:42] <rohanpm> The trick as, AFAIK, you'll have no choice but to explicitly code for every possible QEvent type
[23:42] <lbt> OK I see what you mean
[23:42] <lbt> make copy after inspection
[23:43] <lbt> then assign QQueue<QEvent*>
[23:43] <lbt> then delete on clear()
[23:43] <rohanpm> if (e->type() == QEvent::Paint) m_events << new QPaintEvent(*e); else if (e->type() == QEvent::Resize) m_events << new QResizeEvent(*e); else ...
[23:43] <lbt> luckily I only care about MouseMove/Press/Release
[23:43] <rohanpm> In practice I suspect that will work, but it's not guaranteed to do so, because nowhere is it stated that all QEvents must be copyable
[23:45] <lbt> Well, I'm glad I asked - that would have taken some figuring out.... - thanks for the pointers.... bed now, coding tomorrow (and hopefully I'll dream an answer !)



fix compile warnings on const char
remove some debug output
restructure event handling to record and reissue events if a gesture isn't forthcoming

The watcher passes through these states:

not gesturing :
the default

maybe : 
entered on mousePress(), events are recorded if no stroke occurs
within a timeout, they are reissued and back to not gesturing

gesturing :
entered if enough movement for a stroke occurs within the start
timeout. events from maybe until gesture completed are 'owned' and
discarded.

maybe done :
entered on mouseRelease(), if no press occurs within the multi-stroke
timeout then the gesture is done

done:
entered after the release timeout. The gestures are emitted from the
timerEvent context


