Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

MultiPointTouchArea

The MultiPointTouchArea item enables handling of multiple touch points. More...

Inherits Item

Properties

Signals

Detailed Description

A MultiPointTouchArea is an invisible item that is used to track multiple touch points.

The enabled property is used to enable and disable touch handling. When disabled, the touch area becomes transparent to mouse/touch events.

MultiPointTouchArea can be used in two ways:

While a MultiPointTouchArea can take exclusive ownership of certain touch points, it is also possible to have multiple MultiPointTouchAreas active at the same time, each operating on a different set of touch points.

See also TouchPoint.

Property Documentation

minimumTouchPoints : int

maximumTouchPoints : int

These properties hold the range of touch points to be handled by the touch area.

These are convenience that allow you to, for example, have nested MultiPointTouchAreas, one handling two finger touches, and another handling three finger touches.

By default, all touch points within the touch area are handled.


read-onlytouchPoints : list<TouchPoint>

This property holds a set of user-defined touch point objects that can be bound to.

In the following example, we have two small rectangles that follow our touch points.

 import QtQuick 2.0

 Rectangle {
     width: 400; height: 400
     MultiPointTouchArea {
         anchors.fill: parent
         touchPoints: [
             TouchPoint { id: point1 },
             TouchPoint { id: point2 }
         ]
     }

     Rectangle {
         width: 30; height: 30
         color: "green"
         x: point1.x
         y: point1.y
     }

     Rectangle {
         width: 30; height: 30
         color: "yellow"
         x: point2.x
         y: point2.y
     }
 }

By default this property holds an empty list.

See also TouchPoint.


Signal Documentation

MultiPointTouchArea::onCanceled(list<TouchPoint> touchPoints)

This handler is called when new touch events have been canceled because another element stole the touch event handling.

This signal is for advanced use: it is useful when there is more than one MultiPointTouchArea that is handling input, or when there is a MultiPointTouchArea inside a Flickable. In the latter case, if you execute some logic on the onPressed signal and then start dragging, the Flickable may steal the touch handling from the MultiPointTouchArea. In these cases, to reset the logic when the MultiPointTouchArea has lost the touch handling to the Flickable, onCanceled should be used in addition to onReleased.

touchPoints is the list of canceled points.


MultiPointTouchArea::onGestureStarted(GestureEvent gesture)

This handler is called when the global drag threshold has been reached.

This function is typically used when a MultiPointTouchAreas has been nested in a Flickable or another MultiPointTouchArea. When the threshold has been reached, and the handler called, you can determine whether or not the touch area should grab the current touch points. By default they will not be grabbed; to grab them call gesture.grab(). If the gesture is not grabbed, the nesting Flickable, for example, would also have an opportunity to grab.

The gesture object also includes information on the current set of touchPoints and the dragThreshold.


MultiPointTouchArea::onPressed(list<TouchPoint> touchPoints)

This handler is called when new touch points are added. touchPoints is a list of these new points.

If minimumTouchPoints is set to a value greater than one, this handler will not be called until the minimum number of required touch points has been reached. At that point, onPressed will be called with all the current touch points.


MultiPointTouchArea::onReleased(list<TouchPoint> touchPoints)

This handler is called when existing touch points are removed. touchPoints is a list of these removed points.


MultiPointTouchArea::onTouchUpdated(list<TouchPoint> touchPoints)

This handler is called when the touch points handled by the MultiPointTouchArea change. This includes adding new touch points, removing or canceling previous touch points, as well as updating current touch point data. touchPoints is the list of all current touch points.


MultiPointTouchArea::onUpdated(list<TouchPoint> touchPoints)

This handler is called when existing touch points are updated. touchPoints is a list of these updated points.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web