PDA

View Full Version : Question regarding the flicklist qt sample



advokate3
8th December 2009, 21:15
Sorry if this is a noob question as I'm new to the QT framework
My question is in regards to the sample code posted on the QT blog here:

http://labs.trolltech.com/blogs/2008/11/15/flick-list-or-kinetic-scrolling/

src: http://qt.gitorious.org/qt-labs/graphics-dojo/blobs/62d30fb38b7c5f5f900856ab225ddb0ed74138f3/webgtalk/flickcharm.cpp

In this code, there's this segment:



QMouseEvent *event1 = new QMouseEvent(QEvent::MouseButtonPress,
data->pressPos, Qt::LeftButton,
Qt::LeftButton, Qt::NoModifier);
QMouseEvent *event2 = new QMouseEvent(*mouseEvent);
data->ignored << event1;
data->ignored << event2;


The data->ignored is then used to test for incoming events earlier in the code and the events are discarded if they have been ignored

I'm not sure of the function of the data->ignored list, why keep track of events that the scroller has already ignored if those events will never be dispatched to the object again?