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  · 

WheelEvent

The WheelEvent object provides information about a mouse wheel event. More...

Inherits QtObject

Properties

Detailed Description

The position of the mouse can be found via the x and y properties.

See also MouseArea.

Property Documentation

accepted : bool

Setting accepted to true prevents the wheel event from being propagated to items below this item.

Generally, if the item acts on the wheel event then it should be accepted so that items lower in the stacking order do not also respond to the same event.


read-onlyangleDelta : point

This property holds the distance that the wheel is rotated in wheel degrees. The x and y cordinate of this property holds the delta in horizontal and vertical orientation.

A positive value indicates that the wheel was rotated up/right; a negative value indicates that the wheel was rotated down/left.

Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees.


read-onlybuttons : int

This property holds the mouse buttons pressed when the wheel event was generated.

It contains a bitwise combination of:

  • Qt.LeftButton
  • Qt.RightButton
  • Qt.MiddleButton

read-onlymodifiers : int

This property holds the keyboard modifier flags that existed immediately before the event occurred.

It contains a bitwise combination of:

  • Qt.NoModifier - No modifier key is pressed.
  • Qt.ShiftModifier - A Shift key on the keyboard is pressed.
  • Qt.ControlModifier - A Ctrl key on the keyboard is pressed.
  • Qt.AltModifier - An Alt key on the keyboard is pressed.
  • Qt.MetaModifier - A Meta key on the keyboard is pressed.
  • Qt.KeypadModifier - A keypad button is pressed.

For example, to react to a Control key pressed during the wheel event:

 MouseArea {
     onWheel: {
         if (wheel.modifiers & Qt.ControlModifier) {
             if (wheel.angleDelta.y > 0)
                 zoomIn();
             else
                 zoomOut();
         }
     }
 }

read-onlypixelDelta : point

This property holds the delta in screen pixels and is available in plataforms that have high-resolution trackpads, such as Mac OS X. The x and y cordinate of this property holds the delta in horizontal and vertical orientation. The value should be used directly to scroll content on screen.

For platforms without high-resolution trackpad support, pixelDelta will always be (0,0), and angleDelta should be used instead.


read-onlyx : int

read-onlyy : int

These properties hold the coordinates of the position supplied by the wheel event.


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