Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.
Use background() and QBrush::color() instead.
For example, if you have code like
QColor myColor = backgroundColor();
you can rewrite it as
QColor myColor = background().color();
Note that the background can be a complex brush such as a texture or a gradient.
See also setBackgroundColor().
This is an overloaded member function, provided for convenience.
Use begin() instead.
If the paint device is a QWidget, QPainter is initialized after the widget's settings automatically. Otherwise, you must call the initFrom() function to initialize the painters pen, background and font to the same as any given widget.
For example, if you have code like
QPainter painter(this); painter.begin(device, init);
you can rewrite it as
QPainter painter(this); painter.begin(device); painter.initFrom(init);
This is an overloaded member function, provided for convenience.
Returns the bounding rectangle for the given length of the text constrained by the provided rectangle.
Use boundingRect() combined with QString::left() instead.
For example, if you have code like
QRect rectangle = boundingRect(rect, flags, text, length);
you can rewrite it as
QRect rectangle = boundingRect(rect, flags, text.left(length));
This is an overloaded member function, provided for convenience.
Returns the bounding rectangle for the given length of the text constrained by the rectangle that begins at point (x, y) with the given width and height.
Use boundingRect() combined with QString::left() instead.
For example, if you have code like
QRect rectangle = boundingRect(x, y, width, height, flags, text, length);
you can rewrite it as
QRect rectangle = boundingRect(x, y, width, height, flags, text.left(length));
This is an overloaded member function, provided for convenience.
Use drawConvexPolygon() combined with QPolygonF::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawConvexPolygon(polygon, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawConvexPolygon(polygon.constData() + index, pointCount);
This is an overloaded member function, provided for convenience.
Use drawConvexPolygon() combined with QPolygon::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawConvexPolygon(polygon, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawConvexPolygon(polygon.constData() + index, pointCount);
Draws a cubic Bezier curve defined by the controlPoints, starting at controlPoints[index] (index defaults to 0). Points after controlPoints[index + 3] are ignored. Nothing happens if there aren't enough control points.
Use strokePath() instead.
For example, if you have code like
QPainter painter(this); painter.drawCubicBezier(controlPoints, index)
you can rewrite it as
QPainterPath path; path.moveTo(controlPoints.at(index)); path.cubicTo(controlPoints.at(index+1), controlPoints.at(index+2), controlPoints.at(index+3)); QPainter painter(this); painter.strokePath(path, painter.pen());
Draws count separate lines from points defined by the polygon, starting at polygon[index] (index defaults to 0). If count is -1 (the default) all points until the end of the array are used.
Use drawLines() combined with QPolygon::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawLineSegments(polygon, index, count);
you can rewrite it as
int lineCount = (count == -1) ? (polygon.size() - index) / 2 : count; QPainter painter(this); painter.drawLines(polygon.constData() + index * 2, lineCount);
This is an overloaded member function, provided for convenience.
Draws count points in the vector polygon starting on index using the current pen.
Use drawPoints() combined with QPolygon::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawPoints(polygon, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawPoints(polygon.constData() + index, pointCount);
This is an overloaded member function, provided for convenience.
Use drawPolygon() combined with QPolygonF::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawPolygon(polygon, winding, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; int fillRule = winding ? Qt::WindingFill : Qt::OddEvenFill; QPainter painter(this); painter.drawPolygon( polygon.constData() + index, pointCount, fillRule);
This is an overloaded member function, provided for convenience.
Use drawPolygon() combined with QPolygon::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawPolygon(polygon, winding, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; int fillRule = winding ? Qt::WindingFill : Qt::OddEvenFill; QPainter painter(this); painter.drawPolygon( polygon.constData() + index, pointCount, fillRule);
This is an overloaded member function, provided for convenience.
Draws the polyline defined by the count lines of the given polygon starting at index (index defaults to 0).
Use drawPolyline() combined with QPolygon::constData() instead.
For example, if you have code like
QPainter painter(this); painter.drawPolyline(polygon, index, count);
you can rewrite it as
int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawPolyline(polygon.constData() + index, pointCount);
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::mid() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(x, y, text, pos, length);
you can rewrite it as
QPainter painter(this); painter.drawText(x, y, text.mid(pos, length));
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::mid() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(point, text, pos, length);
you can rewrite it as
QPainter painter(this); painter.drawText(point, text.mid(pos, length));
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::left() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(x, y, text, length);
you can rewrite it as
QPainter painter(this); painter.drawText(x, y, text.left(length));
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::left() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(point, text, length);
you can rewrite it as
QPainter painter(this); painter.drawText(point, text.left(length));
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::left() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(rectangle, flags, text, length, br );
you can rewrite it as
QPainter painter(this); painter.drawText(rectangle, flags, text.left(length), br );
This is an overloaded member function, provided for convenience.
Use drawText() combined with QString::left() instead.
For example, if you have code like
QPainter painter(this); painter.drawText(x, y, width, height, flags, text, length, br );
you can rewrite it as
QPainter painter(this); painter.drawText(x, y, width, height, flags, text.left(length), br );
Use viewTransformEnabled() instead.
Use worldMatrixEnabled() instead.
Use setRedirected() instead.
This is an overloaded member function, provided for convenience.
Use redirected() instead.
Use resetMatrix() instead.
Use setBackground() instead.
See also backgroundColor().
Use setViewTransformEnabled() instead.
See also hasViewXForm().
Use setWorldMatrixEnabled() instead.
See also hasWorldXForm().
Use the worldMatrix() combined with QMatrix::dx() instead.
For example, if you have code like
QPainter painter(this); qreal x = painter.translationX();
you can rewrite it as
QPainter painter(this); qreal x = painter.worldMatrix().dx();
Use the worldMatrix() combined with QMatrix::dy() instead.
For example, if you have code like
QPainter painter(this); qreal y = painter.translationY();
you can rewrite it as
QPainter painter(this); qreal y = painter.worldMatrix().dy();
Use combinedTransform() instead.
This is an overloaded member function, provided for convenience.
Use combinedTransform() instead of this function and call mapRect() on the result to obtain a QRect.
This is an overloaded member function, provided for convenience.
Use combinedTransform() instead.
This is an overloaded member function, provided for convenience.
Use combinedTransform() combined with QPolygon::mid() instead.
For example, if you have code like
QPainter painter(this); QPolygon transformed = painter.xForm(polygon, index, count)
you can rewrite it as
QPainter painter(this); QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix();
Use combinedTransform() combined with QMatrix::inverted() instead.
For example, if you have code like
QPainter painter(this); QPoint transformed = painter.xFormDev(point);
you can rewrite it as
QPainter painter(this); QPoint transformed = point * painter.combinedMatrix().inverted();
This is an overloaded member function, provided for convenience.
Use combineMatrix() combined with QMatrix::inverted() instead.
For example, if you have code like
QPainter painter(this); QRect transformed = painter.xFormDev(rectangle);
you can rewrite it as
QPainter painter(this); QRect transformed = rectangle * painter.combinedMatrix().inverted();
This is an overloaded member function, provided for convenience.
Use combinedMatrix() combined with QMatrix::inverted() instead.
For example, if you have code like
QPainter painter(this); QPolygon transformed = painter.xFormDev(rectangle);
you can rewrite it as
QPainter painter(this); QPolygon transformed = polygon * painter.combinedMatrix().inverted();
This is an overloaded member function, provided for convenience.
Use combinedMatrix() combined with QPolygon::mid() and QMatrix::inverted() instead.
For example, if you have code like
QPainter painter(this); QPolygon transformed = painter.xFormDev(polygon, index, count);
you can rewrite it as
QPainter painter(this); QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix().inverted();
Copyright © 2008 Nokia | Trademarks | Qt 4.4.3 |