> Sent: Thursday, September 28, 2017 at 8:20 AM > From: "André Somers" <[email protected]> > To: [email protected] > Subject: Re: [Development] Pointer Handlers will be Tech Preview in 5.10 > > > > Op 28/09/2017 om 13:42 schreef Tor Arne Vestbø: > > On 28/09/2017 13:36, J-P Nurmi wrote: > >> I would prefer attached properties and signals. Similarly to > >> Keys.onPressed. Attaching onTapped from the outside of a component > >> would be similar to overriding an event handler in C++. There would > >> be a single attached object instance with multiple signal handlers. > >> They objects would not be piling up like FooAreas and BarHandlers > >> do. > > > > Agreed! Gesture.onTapped, Gesture.onDrag, etc? > While on first thought I'd agree, it ends up being less flexible. It > would make it impossible to do things described in the top post, like > having a different action for a two finger pinch versus a three finger > one. So, in the end, I don't think attached properties would work here > unfortunately, as for the common case they'd be really elegant.
Admittedly I don't fully grasp this as I've not worked with the API yet, but... It seems that you have a InputEvent with several onXXXX handlers. I would not like to see many Handler classes, when these things are really mainly only functions. If we work backwards they are handling events from various input devices. Seemingly 2 dimensional, though force touch and resistive touch devices could conceivably provide a 3rd dimension. I'd probably use a single CartesianDevice which would support events that use 1 to 3 dimensional coordinate system. For 1-D devices, X is used, y is 0, Z (depth) is 0. For 2-D devices, X and Y are used, Z/depth is 0. For 3-D devices, X, Y, and Z/depth are used. If anyone ever invents a spherical coordinate system input device PolarDevice... Keystrokes are from KeyDevices.. I never really liked separating gestures from lower order input like mouse clicks, since in my limited experience it's all the same device/driver. I figure the function signatures for Cartesian devices are all the same (EventType, Point, EventData) except for multi-point (EventType, Points[], EventData[]) And this is really what you are coding against? The callback interface/function signature? If so then I would think that single point events are the default, Multi point events are prefixed with multi, etc. The event determines the member (onXXX) and the EventData type onXXX(Point, XXXData) I think someone made a comparison to Keys... I think that would be the example to follow. Also i think this would mimic QMouseEvent, QTouchEvent, QTouchDevice? _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
