It would be nice to say what self and event are. I'm guessing a QGraphicsItem and a parameter of QGraphicsSceneMouseEvent? Is that right?
If so then event.pos() and event.scenePos() are not exchangeable. The first one is cursor position in item's coordinates and the second one cursor position in scene coordinates. They are the same only when item is placed at (0,0). If item is moved they will differ. It's important to note that these values are what they were at the time the event took place, which might be different from the "current" values for item (this is a good thing). For example if you move your mouse fast and there are a lot of events generated the cursor position in these events will be a little behind the actual current position of the cursor before they "catch up".
As for self.scenePos() - this is the position of the item in the scene. This is the point relative to which the event.pos() is calculated. It is not necessary the top left of the bounding rect. It can be placed anywhere using 'setTransformOriginPoint()'. It is often set to the center of the item. For example if you have a bunch of draggable circles a center is probably more convenient than a top left corner. For vertical bars on a chart the origin might be placed at the middle bottom of a bar etc.
As I now understand it there is no easy way to recognize gestures inside the c++ part of a Qt Quick 'QQuickPaintedItem' inherited class, is that correct?
I need both pan and pinch in my c++ class so if i dont want to write my own recognition code should I then inherit my class from both 'QQuickPaintedItem', PinchArea and Flickable? that doesn't seem right? (besides that they are declared in private header files like qquickpincharea_p.h)
@JLimbocker Tried your code but unfortunately it does not exactly what I want. It is selecting from the beginning instead of from where I was clicking when dragging.
Problem with passing the mouse event through to the TextField is that when I do that using mouse.accepted = false. The other handler like onRelease: are not called on the MouseArea anymore which destroys my handling there. The selectAll() could be switched off when something is already selected but I do not know why that TextField's selection is starting from the beginning...
Anyone knows how to forward the mouse events to an underlying element but still have the complete handling in the MouseArea available? That would solve my question.