diff options
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 6e84a3f384..ec1b4c1310 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -4256,7 +4256,7 @@ void QPainter::drawEllipse(const QRectF &r) } /*! - \fn QPainter::drawEllipse(const QRect &rectangle) + \fn void QPainter::drawEllipse(const QRect &rectangle) \overload @@ -4298,7 +4298,7 @@ void QPainter::drawEllipse(const QRect &r) } /*! - \fn QPainter::drawEllipse(int x, int y, int width, int height) + \fn void QPainter::drawEllipse(int x, int y, int width, int height) \overload @@ -4309,7 +4309,7 @@ void QPainter::drawEllipse(const QRect &r) /*! \since 4.4 - \fn QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry) + \fn void QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry) \overload @@ -4319,7 +4319,7 @@ void QPainter::drawEllipse(const QRect &r) /*! \since 4.4 - \fn QPainter::drawEllipse(const QPoint ¢er, int rx, int ry) + \fn void QPainter::drawEllipse(const QPoint ¢er, int rx, int ry) \overload @@ -5744,7 +5744,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText if (d->extended == 0 || !d->state->matrix.isAffine() || !fe->supportsTransformation(d->state->matrix)) { - staticText_d->paintText(topLeftPosition, this); + staticText_d->paintText(topLeftPosition, this, pen().color()); return; } @@ -5816,11 +5816,16 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText QPen oldPen = d->state->pen; QColor currentColor = oldPen.color(); + static const QColor bodyIndicator(0, 0, 0, 0); for (int i=0; i<staticText_d->itemCount; ++i) { QStaticTextItem *item = staticText_d->items + i; - if (item->color.isValid() && currentColor != item->color) { - setPen(item->color); - currentColor = item->color; + if (item->color.isValid() && currentColor != item->color + && item->color != bodyIndicator) { + setPen(item->color); + currentColor = item->color; + } else if (item->color == bodyIndicator) { + setPen(oldPen); + currentColor = oldPen.color(); } d->extended->drawStaticTextItem(item); @@ -5850,7 +5855,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif if (!d->engine || str.isEmpty() || pen().style() == Qt::NoPen) return; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (tf & Qt::TextBypassShaping) { // Skip complex shaping, shape using glyph advances only int len = str.length(); @@ -6737,7 +6742,7 @@ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPo } /*! - \fn QPainter::drawTiledPixmap(const QRect &rectangle, const QPixmap &pixmap, + \fn void QPainter::drawTiledPixmap(const QRect &rectangle, const QPixmap &pixmap, const QPoint &position = QPoint()) \overload @@ -7478,7 +7483,7 @@ start_lengthVariant: if (!expandtabs) { text[offset] = QLatin1Char(' '); } else if (!tabarraylen && !tabstops) { - tabstops = qRound(fm.width(QLatin1Char('x'))*8); + tabstops = qRound(fm.horizontalAdvance(QLatin1Char('x'))*8); } } else if (chr == QChar(ushort(0x9c))) { // string with multiple length variants |