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  · 

QTouchDevice Class

The QTouchDevice class describes the device from with touch events originate. More...

 #include <QTouchDevice>

This class was introduced in Qt 5.0.

Public Types

flags Capabilities
enum CapabilityFlag { Position, Area, Pressure, Velocity, RawPositions, NormalizedPosition }
enum DeviceType { TouchScreen, TouchPad }

Public Functions

QTouchDevice()
~QTouchDevice()
Capabilities capabilities() const
QString name() const
void setCapabilities(Capabilities caps)
void setName(const QString & name)
void setType(DeviceType devType)
DeviceType type() const

Static Public Members

QList<const QTouchDevice *> devices()

Detailed Description

The QTouchDevice class describes the device from with touch events originate.

Each QTouchEvent contains a QTouchDevice pointer to allow accessing device-specific properties like type and capabilities. It is the responsibility of the platform or generic plug-ins to register the available touch devices via QWindowSystemInterface before generating any touch events. Applications do not need to instantiate this class, they should just access the global instances pointed to by QTouchEvent::device().

Member Type Documentation

enum QTouchDevice::CapabilityFlag
flags QTouchDevice::Capabilities

This enum is used with QTouchDevice::capabilities() to indicate what kind of information the touch device or its driver can provide.

ConstantValueDescription
QTouchDevice::Position0x0001Indicates that position information is available, meaning that the pos() family of functions in the touch points return valid points.
QTouchDevice::Area0x0002Indicates that touch area information is available, meaning that the rect() family of functions in the touch points return valid rectangles.
QTouchDevice::Pressure0x0004Indicates that pressure information is available, meaning that pressure() returns a valid value.
QTouchDevice::Velocity0x0008Indicates that velocity information is available, meaning that velocity() returns a valid vector.
QTouchDevice::RawPositions0x0010Indicates that the list returned by QTouchEvent::TouchPoint::rawScreenPositions() may contain one or more positions for each touch point. This is relevant when the touch input gets filtered or corrected on driver level.
QTouchDevice::NormalizedPosition0x0020Indicates that the normalized position is available, meaning that normalizedPos() returns a valid value.

The Capabilities type is a typedef for QFlags<CapabilityFlag>. It stores an OR combination of CapabilityFlag values.

enum QTouchDevice::DeviceType

This enum represents the type of device that generated a QTouchEvent.

ConstantValueDescription
QTouchDevice::TouchScreen0In this type of device, the touch surface and display are integrated. This means the surface and display typically have the same size, such that there is a direct relationship between the touch points' physical positions and the coordinate reported by QTouchEvent::TouchPoint. As a result, Qt allows the user to interact directly with multiple QWidgets and QGraphicsItems at the same time.
QTouchDevice::TouchPad1In this type of device, the touch surface is separate from the display. There is not a direct relationship between the physical touch location and the on-screen coordinates. Instead, they are calculated relative to the current mouse position, and the user must use the touch-pad to move this reference point. Unlike touch-screens, Qt allows users to only interact with a single QWidget or QGraphicsItem at a time.

Member Function Documentation

QTouchDevice::QTouchDevice()

Creates a new touch device instance. By default the name is empty, the only capability is Position and type is TouchScreen.

QTouchDevice::~QTouchDevice()

Capabilities QTouchDevice::capabilities() const

Returns the touch device capabilities.

See also setCapabilities().

QList<const QTouchDevice *> QTouchDevice::devices() [static]

Returns a list of all registered devices.

Note: The returned list cannot be used to add new devices. Use QWindowSystemInterface::registerTouchDevice() instead.

QString QTouchDevice::name() const

Returns the touch device name.

This string may often be empty. It is however useful for systems that have more than one touch input device because there it can be used to differentiate between the devices (i.e. to tell from which device a QTouchEvent originates from).

See also setName().

void QTouchDevice::setCapabilities(Capabilities caps)

Sets the capabilities supported by the device and its driver.

See also capabilities().

void QTouchDevice::setName(const QString & name)

Sets the name (a unique identifier) for the device. In most systems it is enough to leave this unset and keep the default empty name. This identifier becomes important when having multiple touch devices and a need to differentiate between them.

See also name().

void QTouchDevice::setType(DeviceType devType)

Sets the device type.

See also type().

DeviceType QTouchDevice::type() const

Returns the touch device type.

See also setType().

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