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  · 

MapFlickable

The MapFlickable element provides basic flicking of the Map. More...

Inherits QtObject

This type was introduced in Qt Location 5.0.

Properties

Signals

Detailed Description

MapFlickable elements are used as part of a Map, to provide for the common flick gesture that pans the map in an intuitive fashion. This is comparable to the activity of the Flickable element.

A MapFlickable is automatically created with a new Map and available with the flick property. This is the only way to create a MapFlickable, and once created this way cannot be destroyed without its parent Map.

The two most commonly used properties of the MapFlickable are enabled and deceleration. The former must be set in order for the MapFlickable to have any effect upon its parent Map. The latter property customizes the response of the MapFlickable to input from the user, by adjusting how much "friction" slows down the flick after the user has raised their finger or released the mouse button.

Performance

The MapFlickable, when enabled, must process all incoming touch or cursor movement events in order to build up the "flick" gesture, and then complete an animation for the "deceleration" phase. The MapFlickable builds up a buffer of samples during the motion capture phase: currently a maximum of 3 past samples are processed at each new event. As a result, the overhead on movement events can be considered constant time, as there are many more than 3 events in a typical gesture. The cost of animation is identical to two parallel double float QPropertyAnimations with OutQuad easing curves.

Example Usage

The following example enables the flick gesture on a map, and sets the deceleration/friction value to be double its standard level.

 Map {
     flick.enabled: true
     flick.deceleration: 5000
 }

Property Documentation

deceleration : real

This property holds the rate at which a flick will decelerate. The larger the value, the faster the flick decelerates. Default value is 2500, minimum value is 500 and maximum value is 10000.


enabled : bool

This property holds whether the flicking is enabled. By default flicking is enabled. Disabling flicking will terminate any potentially active flicks (movement or actual flick).


Signal Documentation

MapFlickable::onFlickEnded()

This handler is called when the view stops moving due to a flick. The order of onMovementEnded() and onFlickEnded() is not specified.


MapFlickable::onFlickStarted()

This handler is called when the view is flicked. A flick starts from the point that the mouse or touch is released, while still in motion.


MapFlickable::onMovementEnded()

This handler is called when the view stops moving due to user interaction. If a flick was generated, this handler will be triggered once the flick stops. If a flick was not generated, the handler will be triggered when the user stops dragging - that is a mouse or touch release.


MapFlickable::onMovementStarted()

This handler is called when the view begins moving due to user interaction. Typically this means that the user is dragging a finger - or a mouse with one of more mouse buttons pressed - on the map.


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