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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QGraphicsRotation Class Reference

The QGraphicsRotation class provides a rotation transformation around a given axis. More...

 #include <QGraphicsRotation>

Inherits: QGraphicsTransform.

This class was introduced in Qt 4.6.

Properties

  • 1 property inherited from QObject

Public Functions

QGraphicsRotation ( QObject * parent = 0 )
~QGraphicsRotation ()
qreal angle () const
QVector3D axis () const
QVector3D origin () const
void setAngle ( qreal )
void setAxis ( const QVector3D & axis )
void setAxis ( Qt::Axis axis )
void setOrigin ( const QVector3D & point )

Reimplemented Public Functions

virtual void applyTo ( QMatrix4x4 * matrix ) const

Signals

void angleChanged ()
void axisChanged ()
void originChanged ()

Additional Inherited Members

Detailed Description

The QGraphicsRotation class provides a rotation transformation around a given axis.

You can provide the desired axis by assigning a QVector3D to the axis property or by passing a member if Qt::Axis to the setAxis convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis.

The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis.

QGraphicsRotation provides certain parameters to help control how the rotation should be applied.

The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is QPointF(0, 0).

The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times.

Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis.

See also QGraphicsTransform, QGraphicsItem::setRotation(), and QTransform::rotate().

Property Documentation

angle : qreal

This property holds the angle for clockwise rotation, in degrees.

The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.

Access functions:

qreal angle () const
void setAngle ( qreal )

Notifier signal:

void angleChanged ()

See also origin.

axis : QVector3D

This property holds a rotation axis, specified by a vector in 3D space.

This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

Access functions:

QVector3D axis () const
void setAxis ( const QVector3D & axis )
void setAxis ( Qt::Axis axis )

Notifier signal:

void axisChanged ()

See also QTransform and QGraphicsRotation::angle.

origin : QVector3D

This property holds the origin of the rotation in 3D space.

All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).

Access functions:

QVector3D origin () const
void setOrigin ( const QVector3D & point )

Notifier signal:

void originChanged ()

See also angle.

Member Function Documentation

QGraphicsRotation::QGraphicsRotation ( QObject * parent = 0 )

Constructs a new QGraphicsRotation with the given parent.

QGraphicsRotation::~QGraphicsRotation ()

Destroys the graphics rotation.

void QGraphicsRotation::angleChanged () [signal]

This signal is emitted whenever the angle has changed.

See also QGraphicsRotation::angle.

void QGraphicsRotation::applyTo ( QMatrix4x4 * matrix ) const [virtual]

Reimplemented from QGraphicsTransform::applyTo().

void QGraphicsRotation::axisChanged () [signal]

This signal is emitted whenever the axis of the object changes.

See also QGraphicsRotation::axis.

void QGraphicsRotation::originChanged () [signal]

This signal is emitted whenever the origin has changed.

See also QGraphicsRotation::origin.

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e
  1. � Quelque chose ne va vraiment pas avec les d�veloppeurs "modernes" �, un d�veloppeur � "l'ancienne" critique la multiplication des biblioth�ques 59
  2. Apercevoir la troisi�me dimension ou l'utilisation multithread�e d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les d�veloppeurs ignorent-ils trop les failles d�couvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premi�res images du prochain OS de RIM qui devrait int�grer des widgets et des tuiles inspir�es de Windows Phone 0
  5. Quelles nouveaut�s de C++11 Visual C++ doit-il rapidement int�grer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil d�claratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Construire l'avenir : (r�-)introduction aux composants de Qt Quick

Les Qt Labs sont les laboratoires des d�veloppeurs de Qt, o� ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait �tre son futur. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 4.7
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