Why not just Drag, Tap, Pinch ? (for Drag it'd have to be in a different namespace than the actual QtQuick.Drag though)
Best, ------- Jean-Michaël Celerier http://www.jcelerier.name On Wed, Sep 27, 2017 at 7:56 PM, J-P Nurmi <[email protected]> wrote: > On 27 Sep 2017, at 17:35, Shawn Rutledge <[email protected]> wrote: > > > On 27 Sep 2017, at 16:52, J-P Nurmi <[email protected]> wrote: > > On 9 Aug 2017, at 14:10, Shawn Rutledge <[email protected]> wrote: > > […] So far we only have > > TapHandler - […] > DragHandler - […] > PinchHandler - […] > > > > Hi Shawn, > > Why are these types called “handlers”? Because we use term “event handler” > for those methods that you override in C++? IMHO “handler” type names > belong to the same category with “utils” and “helpers”, type names that you > give to internal helper classes when you don’t bother coming up with better > names. You have implemented a gesture framework with support for taps, > pinches, drags, and swipes, so why not call these types “gestures”? > > > The gesture is what it handles. The reason the object exists is to handle > events. > > A TapHandler _handles_ the tap _gesture_. > > (subject verb object) > > If we just replace that one word with yours: > > A TapGesture handles the tap gesture. > > doesn’t sound right to me. > > > Why? > > The problem IMO is mainly that we have the habit of calling a Javascript > block bound to a signal a handler. E.g. a TapHandler could have an > onTapped: { … } Javascript block, and what do you call that: the > TapHandler's onTapped handler? We could be more old-fashioned and start > calling bound Javascript functions callbacks (they are just functions after > all), but it's too hard to break the habit. Or we could try to think of > another unique noun with similar meaning for the handler classes. > > > To the point. :) We may use the handler term in many contexts, but what is > a handler, really? Most Qt classes handle something, but I’m glad we don’t > have too many handlers. I’m not saying the name doesn’t make sense. You > could stick that suffix to almost any class and it would make sense, and > that’s exactly why I put it in the same category with utils and helpers. I > was just hoping we could have nicer names. That’s all. These things are > commonly recognized as gestures. > > Responder maybe, to use macOS terminology? > > Maybe Recognizer, I think I like that. > > > Sounds familiar. Oh, QGestureRecognizer, QPinchGesture, QTapGesture, > QSwipeGesture… :) > > -- > J-P Nurmi > > > _______________________________________________ > Development mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/development > >
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
