Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

Compatibility Members for QPainter

The following class members are part of the Qt 3 compatibility layer. They are provided to help you port old code to Qt 4. We strongly advise against using them in new code.

QPainter class reference

Public Functions

Static Public Members


Member Function Documentation

const QColor & QPainter::backgroundColor () const

Use background().color() instead.

bool QPainter::begin ( QPaintDevice * pdev, const QWidget * init )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

###

void QPainter::drawCubicBezier ( const QPointArray & a, int index = 0 )

Draws a cubic Bezier curve defined by the control points in a, starting at a[index] (index defaults to 0).

Control points after a[index + 3] are ignored. Nothing happens if there aren't enough control points.

void QPainter::drawImage ( const QPoint & p, const QImage & image, const QRect & sr, Qt::ImageConversionFlags conversionFlags = Qt::AutoColor )

Draw a pixmap instead.

For example, if you have code like

    painter.drawImage(p, image, sr, conversionFlags);

you can rewrite it as

    QPixmap pixmap;
    pixmap.convertFromImage(image, conversionFlags);
    painter.drawPixmap(p, pixmap, sr);

void QPainter::drawImage ( const QRect & r, const QImage & image )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Draw a pixmap instead.

For example, if you have code like

    painter.drawImage(r, image);

you can rewrite it as

    painter.drawPixmap(r, QPixmap(image));

void QPainter::drawImage ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags conversionFlags = Qt::AutoColor )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Draw a pixmap instead.

For example, if you have code like

    painter.drawImage(x, y, image, sx, sy, sw, sh, conversionFlags);

you can rewrite it as

    QPixmap pixmap;
    pixmap.convertFromImage(image, conversionFlags);
    painter.drawPixmap(QPoint(x, y), pixmap, QRect(sx, sy, sw, sh));

void QPainter::drawImage ( const QPoint & p, const QImage & image )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Draw a pixmap instead.

For example, if you have code like

    painter.drawImage(p, image);

you can rewrite it as

    painter.drawPixmap(p, QPixmap(image));

void QPainter::drawText ( int x, int y, const QString & text, int pos, int len, TextDirection dir = Auto )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use drawText(x, y, text.mid(pos, len), dir) instead.

void QPainter::drawText ( const QPoint & p, const QString & text, int pos, int len, TextDirection dir = Auto )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use drawText(p, text.mid(pos, len), dir) instead.

void QPainter::drawText ( int x, int y, const QString & text, int len, TextDirection dir = Auto )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use drawText(x, y, text.left(len), dir) instead.

void QPainter::drawText ( const QPoint & p, const QString & s, int len, TextDirection dir = Auto )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use drawText(p, text.left(len), dir) instead.

bool QPainter::hasWorldXForm () const

void QPainter::redirect ( QPaintDevice * pdev, QPaintDevice * replacement )   [static]

Use setRedirected() instead.

QPaintDevice * QPainter::redirect ( QPaintDevice * pdev )   [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use redirected() instead.

void QPainter::resetXForm ()

void QPainter::setBackgroundColor ( const QColor & color )

Use setBackground() instead.

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

void QPainter::setWorldXForm ( bool enabled )

const QMatrix & QPainter::worldMatrix () const

QPoint QPainter::xForm ( const QPoint & p ) const

Returns the point p transformed from model coordinates to device coordinates.

See also xFormDev() and QMatrix::map().

QRect QPainter::xForm ( const QRect & r ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the rectangle r transformed from model coordinates to device coordinates.

If world transformation is enabled and rotation or shearing has been specified, then the bounding rectangle is returned.

See also xFormDev() and QMatrix::map().

QPointArray QPainter::xForm ( const QPointArray & a ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the point array a transformed from model coordinates to device coordinates.

See also xFormDev() and QMatrix::map().

QPointArray QPainter::xForm ( const QPointArray & av, int index, int npoints ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the point array av transformed from model coordinates to device coordinates. The index is the first point in the array and npoints denotes the number of points to be transformed. If npoints is negative, all points from av[index] until the last point in the array are transformed.

The returned point array consists of the number of points that were transformed.

Example:

    QPointArray a(10);
    QPointArray b;
    b = painter.xForm(a, 2, 4);  // b.size() == 4
    b = painter.xForm(a, 2, -1); // b.size() == 8

See also xFormDev() and QMatrix::map().

QRect QPainter::xFormDev ( const QRect & r ) const

Returns the rectangle r transformed from device coordinates to model coordinates.

If world transformation is enabled and rotation or shearing is used, then the bounding rectangle is returned.

See also xForm() and QMatrix::map().

QPoint QPainter::xFormDev ( const QPoint & p ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the point p transformed from device coordinates to model coordinates.

See also xForm() and QMatrix::map().

QPointArray QPainter::xFormDev ( const QPointArray & a ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the point array a transformed from device coordinates to model coordinates.

See also xForm() and QMatrix::map().

QPointArray QPainter::xFormDev ( const QPointArray & ad, int index, int npoints ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the point array ad transformed from device coordinates to model coordinates. The index is the first point in the array and npoints denotes the number of points to be transformed. If npoints is negative, all points from ad[index] until the last point in the array are transformed.

The returned point array consists of the number of points that were transformed.

Example:

    QPointArray a(10);
    QPointArray b;
    b = painter.xFormDev(a, 1, 3);  // b.size() == 3
    b = painter.xFormDev(a, 1, -1); // b.size() == 9

See also xForm() and QMatrix::map().


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp2