Qt 3 Support Members for QPainterОписанные ниже члены класса являются частью слоя поддержки Qt 3. Они введены для поддержки старого кода в Qt 4. Мы советуем не использовать их во вновь создаваемом коде. Открытые функции
Статические открытые члены
Описание функций-членовconst QColor & QPainter::backgroundColor () constUse background() and QBrush::color() instead. Например, если у вас есть код QColor myColor = backgroundColor(); вы можете записать его в виде QColor myColor = background().color(); Note that the background can be a complex brush such as a texture or a gradient. See also setBackgroundColor(). bool QPainter::begin ( QPaintDevice * device, const QWidget * init )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. Например, если у вас есть код QPainter painter(this); painter.begin(device, init); вы можете записать его в виде QPainter painter(this); painter.begin(device); painter.initFrom(init); QRect QPainter::boundingRect ( const QRect & rectangle, int flags, const QString & text, int length )Returns the bounding rectangle for the given length of the text constrained by the provided rectangle. Use boundingRect() combined with QString::left() instead. Например, если у вас есть код QRect rectangle = boundingRect(rect, flags, text, length); вы можете записать его в виде QRect rectangle = boundingRect(rect, flags, text.left(length)); QRect QPainter::boundingRect ( int x, int y, int width, int height, int flags, const QString & text, int length )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. Например, если у вас есть код QRect rectangle = boundingRect(x, y, width, height, flags, text, length); вы можете записать его в виде QRect rectangle = boundingRect(x, y, width, height, flags, text.left(length)); void QPainter::drawConvexPolygon ( const QPolygonF & polygon, int index, int count = -1 )Это перегруженная функция. Use drawConvexPolygon() combined with QPolygonF::constData() instead. Например, если у вас есть код QPainter painter(this); painter.drawConvexPolygon(polygon, index, count); вы можете записать его в виде int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawConvexPolygon(polygon.constData() + index, pointCount); void QPainter::drawConvexPolygon ( const QPolygon & polygon, int index, int count = -1 )Это перегруженная функция. Use drawConvexPolygon() combined with QPolygon::constData() instead. Например, если у вас есть код QPainter painter(this); painter.drawConvexPolygon(polygon, index, count); вы можете записать его в виде int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawConvexPolygon(polygon.constData() + index, pointCount); void QPainter::drawCubicBezier ( const QPolygon & controlPoints, int index = 0 )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. Например, если у вас есть код QPainter painter(this); painter.drawCubicBezier(controlPoints, index) вы можете записать его в виде 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()); void QPainter::drawLineSegments ( const QPolygon & polygon, int index = 0, int count = -1 )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. Например, если у вас есть код QPainter painter(this); painter.drawLineSegments(polygon, index, count); вы можете записать его в виде int lineCount = (count == -1) ? (polygon.size() - index) / 2 : count; QPainter painter(this); painter.drawLines(polygon.constData() + index * 2, lineCount); void QPainter::drawPoints ( const QPolygon & polygon, int index, int count = -1 )Это перегруженная функция. Draws count points in the vector polygon starting on index using the current pen. Use drawPoints() combined with QPolygon::constData() instead. Например, если у вас есть код QPainter painter(this); painter.drawPoints(polygon, index, count); вы можете записать его в виде int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawPoints(polygon.constData() + index, pointCount); void QPainter::drawPolygon ( const QPolygonF & polygon, bool winding, int index = 0, int count = -1 )Это перегруженная функция. Use drawPolygon() combined with QPolygonF::constData() instead. Например, если у вас есть код QPainter painter(this); painter.drawPolygon(polygon, winding, index, count); вы можете записать его в виде 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); void QPainter::drawPolygon ( const QPolygon & polygon, bool winding, int index = 0, int count = -1 )Это перегруженная функция. Use drawPolygon() combined with QPolygon::constData() instead. Например, если у вас есть код QPainter painter(this); painter.drawPolygon(polygon, winding, index, count); вы можете записать его в виде 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); void QPainter::drawPolyline ( const QPolygon & polygon, int index, int count = -1 )Это перегруженная функция. 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. Например, если у вас есть код QPainter painter(this); painter.drawPolyline(polygon, index, count); вы можете записать его в виде int pointCount = (count == -1) ? polygon.size() - index : count; QPainter painter(this); painter.drawPolyline(polygon.constData() + index, pointCount); void QPainter::drawText ( int x, int y, const QString & text, int pos, int length )Use drawText() combined with QString::mid() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(x, y, text, pos, length); вы можете записать его в виде QPainter painter(this); painter.drawText(x, y, text.mid(pos, length)); void QPainter::drawText ( const QPoint & point, const QString & text, int pos, int length )Use drawText() combined with QString::mid() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(point, text, pos, length); вы можете записать его в виде QPainter painter(this); painter.drawText(point, text.mid(pos, length)); void QPainter::drawText ( int x, int y, const QString & text, int length )Use drawText() combined with QString::left() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(x, y, text, length); вы можете записать его в виде QPainter painter(this); painter.drawText(x, y, text.left(length)); void QPainter::drawText ( const QPoint & point, const QString & text, int length )Use drawText() combined with QString::left() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(point, text, length); вы можете записать его в виде QPainter painter(this); painter.drawText(point, text.left(length)); void QPainter::drawText ( const QRect & rectangle, int flags, const QString & text, int length, QRect * br = 0 )Use drawText() combined with QString::left() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(rectangle, flags, text, length, br ); вы можете записать его в виде QPainter painter(this); painter.drawText(rectangle, flags, text.left(length), br ); void QPainter::drawText ( int x, int y, int width, int height, int flags, const QString & text, int length, QRect * br = 0 )Use drawText() combined with QString::left() instead. Например, если у вас есть код QPainter painter(this); painter.drawText(x, y, width, height, flags, text, length, br ); вы можете записать его в виде QPainter painter(this); painter.drawText(x, y, width, height, flags, text.left(length), br ); bool QPainter::hasViewXForm () constUse viewTransformEnabled() instead. bool QPainter::hasWorldXForm () constUse worldMatrixEnabled() instead. void QPainter::redirect ( QPaintDevice * pdev, QPaintDevice * replacement ) [static]Use setRedirected() instead. QPaintDevice * QPainter::redirect ( QPaintDevice * pdev ) [static]Use redirected() instead. void QPainter::resetXForm ()Use resetMatrix() instead. void QPainter::setBackgroundColor ( const QColor & color )Use setBackground() instead. See also backgroundColor(). void QPainter::setViewXForm ( bool enabled )Use setViewTransformEnabled() instead. See also hasViewXForm(). void QPainter::setWorldXForm ( bool enabled )Use setWorldMatrixEnabled() instead. See also hasWorldXForm(). qreal QPainter::translationX () constUse the worldMatrix() combined with QMatrix::dx() instead. Например, если у вас есть код QPainter painter(this); qreal x = painter.translationX(); вы можете записать его в виде QPainter painter(this); qreal x = painter.worldMatrix().dx(); qreal QPainter::translationY () constUse the worldMatrix() combined with QMatrix::dy() instead. Например, если у вас есть код QPainter painter(this); qreal y = painter.translationY(); вы можете записать его в виде QPainter painter(this); qreal y = painter.worldMatrix().dy(); QPoint QPainter::xForm ( const QPoint & point ) constUse combinedTransform() instead. QRect QPainter::xForm ( const QRect & rectangle ) constЭто перегруженная функция. Use combinedTransform() instead of this function and call mapRect() on the result to obtain a QRect. QPolygon QPainter::xForm ( const QPolygon & polygon ) constЭто перегруженная функция. Use combinedTransform() instead. QPolygon QPainter::xForm ( const QPolygon & polygon, int index, int count ) constЭто перегруженная функция. Use combinedTransform() combined with QPolygon::mid() instead. Например, если у вас есть код QPainter painter(this); QPolygon transformed = painter.xForm(polygon, index, count) вы можете записать его в виде QPainter painter(this); QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix(); QPoint QPainter::xFormDev ( const QPoint & point ) constЭто перегруженная функция. Use combinedTransform() combined with QMatrix::inverted() instead. Например, если у вас есть код QPainter painter(this); QPoint transformed = painter.xFormDev(point); вы можете записать его в виде QPainter painter(this); QPoint transformed = point * painter.combinedMatrix().inverted(); QRect QPainter::xFormDev ( const QRect & rectangle ) constЭто перегруженная функция. Use mapRect() combined with QMatrix::inverted() instead. Например, если у вас есть код QPainter painter(this); QRect transformed = painter.xFormDev(rectangle); вы можете записать его в виде QPainter painter(this); QRect transformed = painter.combinedMatrix().inverted(rectangle); QPolygon QPainter::xFormDev ( const QPolygon & polygon ) constЭто перегруженная функция. Это перегруженная функция. Use combinedMatrix() combined with QMatrix::inverted() instead. Например, если у вас есть код QPainter painter(this); QPolygon transformed = painter.xFormDev(rectangle); вы можете записать его в виде QPainter painter(this); QPolygon transformed = polygon * painter.combinedMatrix().inverted(); QPolygon QPainter::xFormDev ( const QPolygon & polygon, int index, int count ) constЭто перегруженная функция. Use combinedMatrix() combined with QPolygon::mid() and QMatrix::inverted() instead. Например, если у вас есть код QPainter painter(this); QPolygon transformed = painter.xFormDev(polygon, index, count); вы можете записать его в виде QPainter painter(this); QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix().inverted();
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |