|
From: Mojca M. <moj...@gm...> - 2012-01-09 16:02:54
|
On Mon, Jan 9, 2012 at 00:33, Ethan Merritt wrote: > On Sunday, 08 January 2012, Mojca Miklavec wrote: >> 4.) I would like to understand what part of gnuplot's source code is >> aware of mouse scrolling events (is receiving signals from operating >> system, so that GE_buttonrelease is set for example). > > The terminals notifies the core mousing routines by filling in an > event structure and calling do_event() in mouse.c. > > For the qt terminal the sequence of calls is > thread 1: > m_eventHandler->postTermEvent( event_type, x, y, parameter1, parameter2, winid ) > > thread 2: > qt_waitforinput() > -> qt_processTermEvent(gp_event_t* event) > -> do_event() > > The methods for specific event types are defined in QtGnuplotScene.cpp: > QtGnuplotScene::wheelEvent(QGraphicsSceneWheelEvent* event) > QtGnuplotScene::keyPressEvent(QKeyEvent* event) > QtGnuplotScene::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) > and so on. > > Does that answer the question? Yes, thank you. That piece of information makes it perfectly clear. Now I see that in order to add extra event, I need a new class, QtGnuplotGesture (in addition to QtGnuplotScene) for example. I might need more information later, but for now this is enough to start experimenting. Mojca |