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  · 

Obsolete Members for QPainter

The following class members are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

QMatrix combinedMatrix () const (obsolete)
const QMatrix & deviceMatrix () const (obsolete)
void drawRoundRect ( const QRectF & r, int xRnd = 25, int yRnd = 25 ) (obsolete)
void drawRoundRect ( const QRect & r, int xRnd = 25, int yRnd = 25 ) (obsolete)
void drawRoundRect ( int x, int y, int w, int h, int xRnd = 25, int yRnd = 25 ) (obsolete)
const QMatrix & matrix () const (obsolete)
bool matrixEnabled () const (obsolete)
void resetMatrix () (obsolete)
void setMatrix ( const QMatrix & matrix, bool combine = false ) (obsolete)
void setMatrixEnabled ( bool enable ) (obsolete)
void setWorldMatrix ( const QMatrix & matrix, bool combine = false ) (obsolete)
const QMatrix & worldMatrix () const (obsolete)

Static Public Members

QPaintDevice * redirected ( const QPaintDevice * device, QPoint * offset = 0 ) (obsolete)
void restoreRedirected ( const QPaintDevice * device ) (obsolete)
void setRedirected ( const QPaintDevice * device, QPaintDevice * replacement, const QPoint & offset = QPoint() ) (obsolete)

Member Function Documentation

QMatrix QPainter::combinedMatrix () const

Returns the transformation matrix combining the current window/viewport and world transformation.

It is advisable to use combinedTransform() instead of this function to preserve the properties of perspective transformations.

This function was introduced in Qt 4.2.

See also setWorldTransform(), setWindow(), and setViewport().

const QMatrix & QPainter::deviceMatrix () const

Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.

Note: It is advisable to use deviceTransform() instead of this function to preserve the properties of perspective transformations.

This function is only needed when using platform painting commands on the platform dependent handle (Qt::HANDLE), and the platform does not do transformations nativly.

The QPaintEngine::PaintEngineFeature enum can be queried to determine whether the platform performs the transformations or not.

See also worldMatrix() and QPaintEngine::hasFeature().

void QPainter::drawRoundRect ( const QRectF & r, int xRnd = 25, int yRnd = 25 )

Draws a rectangle r with rounded corners.

The xRnd and yRnd arguments specify how rounded the corners should be. 0 is angled corners, 99 is maximum roundedness.

A filled rectangle has a size of r.size(). A stroked rectangle has a size of r.size() plus the pen width.

See also drawRoundedRect().

void QPainter::drawRoundRect ( const QRect & r, int xRnd = 25, int yRnd = 25 )

This is an overloaded function.

Draws the rectangle r with rounded corners.

void QPainter::drawRoundRect ( int x, int y, int w, int h, int xRnd = 25, int yRnd = 25 )

This is an overloaded function.

Draws the rectangle x, y, w, h with rounded corners.

const QMatrix & QPainter::matrix () const

Use worldTransform() instead.

See also setMatrix() and worldTransform().

bool QPainter::matrixEnabled () const

Use worldMatrixEnabled() instead

See also setMatrixEnabled() and worldMatrixEnabled().

QPaintDevice * QPainter::redirected ( const QPaintDevice * device, QPoint * offset = 0 ) [static]

Using QWidget::render() obsoletes the use of this function.

Returns the replacement for given device. The optional out parameter offset returns the offset within the replaced device.

Warning: Making use of redirections in the QPainter API implies that QPainter::begin() and QPaintDevice destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.

Note: This function is thread-safe.

See also setRedirected() and restoreRedirected().

void QPainter::resetMatrix ()

Resets any transformations that were made using translate(), scale(), shear(), rotate(), setWorldMatrix(), setViewport() and setWindow().

It is advisable to use resetTransform() instead of this function to preserve the properties of perspective transformations.

See also Coordinate Transformations.

void QPainter::restoreRedirected ( const QPaintDevice * device ) [static]

Using QWidget::render() obsoletes the use of this function.

Restores the previous redirection for the given device after a call to setRedirected().

Warning: Making use of redirections in the QPainter API implies that QPainter::begin() and QPaintDevice destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.

Note: This function is thread-safe.

See also redirected().

void QPainter::setMatrix ( const QMatrix & matrix, bool combine = false )

Use setWorldTransform() instead.

See also matrix() and setWorldTransform().

void QPainter::setMatrixEnabled ( bool enable )

Use setWorldMatrixEnabled() instead.

See also matrixEnabled() and setWorldMatrixEnabled().

void QPainter::setRedirected ( const QPaintDevice * device, QPaintDevice * replacement, const QPoint & offset = QPoint() ) [static]

Please use QWidget::render() instead.

Redirects all paint commands for the given paint device, to the replacement device. The optional point offset defines an offset within the source device.

The redirection will not be effective until the begin() function has been called; make sure to call end() for the given device's painter (if any) before redirecting. Call restoreRedirected() to restore the previous redirection.

Warning: Making use of redirections in the QPainter API implies that QPainter::begin() and QPaintDevice destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.

Note: This function is thread-safe.

See also redirected() and restoreRedirected().

void QPainter::setWorldMatrix ( const QMatrix & matrix, bool combine = false )

Sets the transformation matrix to matrix and enables transformations.

Note: It is advisable to use setWorldTransform() instead of this function to preserve the properties of perspective transformations.

If combine is true, then matrix is combined with the current transformation matrix; otherwise matrix replaces the current transformation matrix.

If matrix is the identity matrix and combine is false, this function calls setWorldMatrixEnabled(false). (The identity matrix is the matrix where QMatrix::m11() and QMatrix::m22() are 1.0 and the rest are 0.0.)

The following functions can transform the coordinate system without using a QMatrix:

They operate on the painter's worldMatrix() and are implemented like this:

 void QPainter::rotate(qreal angle)
 {
     QMatrix matrix;
     matrix.rotate(angle);
     setWorldMatrix(matrix, true);
 }

Note that when using setWorldMatrix() function you should always have combine be true when you are drawing into a QPicture. Otherwise it may not be possible to replay the picture with additional transformations; using the translate(), scale(), etc. convenience functions is safe.

For more information about the coordinate system, transformations and window-viewport conversion, see Coordinate System.

This function was introduced in Qt 4.2.

See also worldMatrix(), setWorldTransform(), and QTransform.

const QMatrix & QPainter::worldMatrix () const

Returns the world transformation matrix.

It is advisable to use worldTransform() because worldMatrix() does not preserve the properties of perspective transformations.

This function was introduced in Qt 4.2.

See also setWorldMatrix(), Coordinate Transformations, and Coordinate System.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  4. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 10
  5. 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
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
Page suivante

Le Qt Quarterly au hasard

Logo

Déployer dans le Bazaar

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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