diff options
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b992e8f55d..4a18df899e 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -190,6 +190,13 @@ void QPainterPrivate::checkEmulation() if (pg && pg->coordinateMode() > QGradient::LogicalMode) doEmulation = true; + if (state->brush.style() == Qt::TexturePattern) { + if (qHasPixmapTexture(state->brush)) + doEmulation |= !qFuzzyCompare(state->brush.texture().devicePixelRatioF(), 1.0); + else + doEmulation |= !qFuzzyCompare(state->brush.textureImage().devicePixelRatioF(), 1.0); + } + if (doEmulation && extended->flags() & QPaintEngineEx::DoNotEmulate) return; @@ -6657,6 +6664,16 @@ QRectF QPainter::boundingRect(const QRectF &r, const QString &text, const QTextO potentially much more efficient depending on the underlying window system. + drawTiledPixmap() will produce the same visual tiling pattern on + high-dpi displays (with devicePixelRatio > 1), compared to normal- + dpi displays. Set the devicePixelRatio on the \a pixmap to control + the tile size. For example, setting it to 2 halves the tile width + and height (on both 1x and 2x displays), and produces high-resolution + output on 2x displays. + + The \a position offset is always in the painter coordinate system, + indepentent of display devicePixelRatio. + \sa drawPixmap() */ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &sp) @@ -7068,6 +7085,37 @@ void QPainter::fillRect(const QRectF &r, const QColor &color) */ /*! + \fn void QPainter::fillRect(int x, int y, int width, int height, QGradient::Preset preset) + + \overload + + Fills the rectangle beginning at (\a{x}, \a{y}) with the given \a + width and \a height, using the given gradient \a preset. + + \since 5.12 +*/ + +/*! + \fn void QPainter::fillRect(const QRect &rectangle, QGradient::Preset preset); + + \overload + + Fills the given \a rectangle with the specified gradient \a preset. + + \since 5.12 +*/ + +/*! + \fn void QPainter::fillRect(const QRectF &rectangle, QGradient::Preset preset); + + \overload + + Fills the given \a rectangle with the specified gradient \a preset. + + \since 5.12 +*/ + +/*! Sets the given render \a hint on the painter if \a on is true; otherwise clears the render hint. |