diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 7 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 170 | ||||
-rw-r--r-- | src/gui/painting/qpainter.h | 28 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 140 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.h | 17 |
5 files changed, 0 insertions, 362 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 5b7f8511ba..6360f32682 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -905,13 +905,6 @@ void QRasterPaintEngine::renderHintsChanged() bool was_bilinear = s->flags.bilinear; s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing); -#if QT_DEPRECATED_SINCE(5, 14) -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - if (s->renderHints & QPainter::HighQualityAntialiasing) - s->flags.antialiased = true; -QT_WARNING_POP -#endif s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform); s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index fc93ffa19f..a210216604 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1430,12 +1430,6 @@ void QPainterPrivate::updateState(QPainterState *newState) a smooth pixmap transformation algorithm (such as bilinear) rather than nearest neighbor. - \value HighQualityAntialiasing This value is obsolete and will be ignored, - use the Antialiasing render hint instead. - - \value NonCosmeticDefaultPen This value is obsolete, the default for QPen - is now non-cosmetic. - \value Qt4CompatiblePainting Compatibility hint telling the engine to use the same X11 based fill rules as in Qt 4, where aliased rendering is offset by slightly less than half a pixel. Also will treat default constructed pens @@ -1551,23 +1545,6 @@ bool QPainter::isActive() const return d->engine; } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - Initializes the painters pen, background and font to the same as - the given \a device. - - \obsolete - - \sa begin(), {QPainter#Settings}{Settings} -*/ -void QPainter::initFrom(const QPaintDevice *device) -{ - Q_ASSERT_X(device, "QPainter::initFrom(const QPaintDevice *device)", "QPaintDevice cannot be 0"); - Q_D(QPainter); - d->initFrom(device); -} -#endif - void QPainterPrivate::initFrom(const QPaintDevice *device) { if (!engine) { @@ -4001,54 +3978,6 @@ void QPainter::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Draws the given rectangle \a x, \a y, \a w, \a h with rounded corners. */ -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \obsolete - - Draws a rectangle \a r with rounded corners. - - The \a xRnd and \a yRnd arguments specify how rounded the corners - should be. 0 is angled corners, 99 is maximum roundedness. - - A filled rectangle has a size of r.size(). A stroked rectangle - has a size of r.size() plus the pen width. - - \sa drawRoundedRect() -*/ -void QPainter::drawRoundRect(const QRectF &r, int xRnd, int yRnd) -{ - drawRoundedRect(r, xRnd, yRnd, Qt::RelativeSize); -} - - -/*! - \fn void QPainter::drawRoundRect(const QRect &r, int xRnd = 25, int yRnd = 25) - - \overload - \obsolete - - Draws the rectangle \a r with rounded corners. -*/ -void QPainter::drawRoundRect(const QRect &rect, int xRnd, int yRnd) -{ - drawRoundedRect(QRectF(rect), xRnd, yRnd, Qt::RelativeSize); -} - -/*! - \obsolete - - \fn QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd) - - \overload - - Draws the rectangle \a x, \a y, \a w, \a h with rounded corners. -*/ -void QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd) -{ - drawRoundedRect(QRectF(x, y, w, h), xRnd, yRnd, Qt::RelativeSize); -} -#endif - /*! \fn void QPainter::drawEllipse(const QRectF &rectangle) @@ -5692,22 +5621,6 @@ 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_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(); - int numGlyphs = len; - QVarLengthGlyphLayoutArray glyphs(len); - QFontEngine *fontEngine = d->state->font.d->engineForScript(QChar::Script_Common); - if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, { })) - Q_UNREACHABLE(); - - QTextItemInt gf(glyphs, &d->state->font, str.data(), len, fontEngine); - drawTextItem(p, gf); - return; - } -#endif - QStackTextEngine engine(str, d->state->font); engine.option.setTextDirection(d->state->layoutDirection); if (tf & (Qt::TextForceLeftToRight|Qt::TextForceRightToLeft)) { @@ -7193,89 +7106,6 @@ void QPainter::setViewTransformEnabled(bool enable) d->updateMatrix(); } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \threadsafe - - \obsolete - - Please use QWidget::render() instead. - - Redirects all paint commands for the given paint \a device, to the - \a replacement device. The optional point \a offset defines an - offset within the source device. - - The redirection will not be effective until the begin() function - has been called; make sure to call end() for the given \a - device's painter (if any) before redirecting. Call - restoreRedirected() to restore the previous redirection. - - \warning Making use of redirections in the QPainter API implies - that QPainter::begin() and QPaintDevice destructors need to hold - a mutex for a short period. This can impact performance. Use of - QWidget::render is strongly encouraged. - - \sa redirected(), restoreRedirected() -*/ -void QPainter::setRedirected(const QPaintDevice *device, - QPaintDevice *replacement, - const QPoint &offset) -{ - Q_ASSERT(device != nullptr); - Q_UNUSED(device) - Q_UNUSED(replacement) - Q_UNUSED(offset) - qWarning("QPainter::setRedirected(): ignoring call to deprecated function, use QWidget::render() instead"); -} - -/*! - \threadsafe - - \obsolete - - Using QWidget::render() obsoletes the use of this function. - - Restores the previous redirection for the given \a device after a - call to setRedirected(). - - \warning Making use of redirections in the QPainter API implies - that QPainter::begin() and QPaintDevice destructors need to hold - a mutex for a short period. This can impact performance. Use of - QWidget::render is strongly encouraged. - - \sa redirected() - */ -void QPainter::restoreRedirected(const QPaintDevice *device) -{ - Q_UNUSED(device) - qWarning("QPainter::restoreRedirected(): ignoring call to deprecated function, use QWidget::render() instead"); -} - -/*! - \threadsafe - - \obsolete - - Using QWidget::render() obsoletes the use of this function. - - Returns the replacement for given \a device. The optional out - parameter \a offset returns the offset within the replaced device. - - \warning Making use of redirections in the QPainter API implies - that QPainter::begin() and QPaintDevice destructors need to hold - a mutex for a short period. This can impact performance. Use of - QWidget::render is strongly encouraged. - - \sa setRedirected(), restoreRedirected() -*/ -QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) -{ - Q_UNUSED(device) - Q_UNUSED(offset) - return nullptr; -} -#endif - void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, const QString& str, QRectF *brect, int tabstops, int *ta, int tabarraylen, diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h index 52de8b6839..4d2efb1e67 100644 --- a/src/gui/painting/qpainter.h +++ b/src/gui/painting/qpainter.h @@ -87,10 +87,6 @@ public: Antialiasing = 0x01, TextAntialiasing = 0x02, SmoothPixmapTransform = 0x04, -#if QT_DEPRECATED_SINCE(5, 14) - HighQualityAntialiasing Q_DECL_ENUMERATOR_DEPRECATED_X("Use Antialiasing instead") = 0x08, - NonCosmeticDefaultPen Q_DECL_ENUMERATOR_DEPRECATED_X("Default pen is non-cosmetic now") = 0x10, -#endif Qt4CompatiblePainting = 0x20, LosslessImageRendering = 0x40, }; @@ -132,11 +128,6 @@ public: bool end(); bool isActive() const; -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use begin(QPaintDevice*) instead") - void initFrom(const QPaintDevice *device); -#endif - enum CompositionMode { CompositionMode_SourceOver, CompositionMode_DestinationOver, @@ -346,15 +337,6 @@ public: inline void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize); -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use drawRoundedRect(..., Qt::RelativeSize) instead") - void drawRoundRect(const QRectF &r, int xround = 25, int yround = 25); - QT_DEPRECATED_X("Use drawRoundedRect(..., Qt::RelativeSize) instead") - void drawRoundRect(int x, int y, int w, int h, int = 25, int = 25); - QT_DEPRECATED_X("Use drawRoundedRect(..., Qt::RelativeSize) instead") - void drawRoundRect(const QRect &r, int xround = 25, int yround = 25); -#endif - void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset = QPointF()); inline void drawTiledPixmap(int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0); inline void drawTiledPixmap(const QRect &, const QPixmap &, const QPoint & = QPoint()); @@ -460,16 +442,6 @@ public: QPaintEngine *paintEngine() const; -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use QWidget::render() instead") - static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement, - const QPoint& offset = QPoint()); - QT_DEPRECATED_X("Use QWidget::render() instead") - static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = nullptr); - QT_DEPRECATED_X("Use QWidget::render() instead") - static void restoreRedirected(const QPaintDevice *device); -#endif - void beginNativePainting(); void endNativePainting(); diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e3cdc218b2..de0b3f3998 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -3233,131 +3233,6 @@ void QPainterPath::addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadi Adds the given rectangle \a x, \a y, \a w, \a h with rounded corners to the path. */ -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \obsolete - - Adds a rectangle \a r with rounded corners to the path. - - The \a xRnd and \a yRnd arguments specify how rounded the corners - should be. 0 is angled corners, 99 is maximum roundedness. - - \sa addRoundedRect() -*/ -void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) -{ - if(xRnd >= 100) // fix ranges - xRnd = 99; - if(yRnd >= 100) - yRnd = 99; - if(xRnd <= 0 || yRnd <= 0) { // add normal rectangle - addRect(r); - return; - } - - QRectF rect = r.normalized(); - - if (rect.isNull()) - return; - - qreal x = rect.x(); - qreal y = rect.y(); - qreal w = rect.width(); - qreal h = rect.height(); - qreal rxx2 = w*xRnd/100; - qreal ryy2 = h*yRnd/100; - - ensureData(); - detach(); - - bool first = d_func()->elements.size() < 2; - - arcMoveTo(x, y, rxx2, ryy2, 180); - arcTo(x, y, rxx2, ryy2, 180, -90); - arcTo(x+w-rxx2, y, rxx2, ryy2, 90, -90); - arcTo(x+w-rxx2, y+h-ryy2, rxx2, ryy2, 0, -90); - arcTo(x, y+h-ryy2, rxx2, ryy2, 270, -90); - closeSubpath(); - - d_func()->require_moveTo = true; - d_func()->convex = first; -} - -/*! - \obsolete - - \fn bool QPainterPath::addRoundRect(const QRectF &rect, int roundness); - \since 4.3 - \overload - - Adds a rounded rectangle, \a rect, to the path. - - The \a roundness argument specifies uniform roundness for the - rectangle. Vertical and horizontal roundness factors will be - adjusted accordingly to act uniformly around both axes. Use this - method if you want a rectangle equally rounded across both the X and - Y axis. - - \sa addRoundedRect() -*/ -void QPainterPath::addRoundRect(const QRectF &rect, - int roundness) -{ - int xRnd = roundness; - int yRnd = roundness; - if (rect.width() > rect.height()) - xRnd = int(roundness * rect.height()/rect.width()); - else - yRnd = int(roundness * rect.width()/rect.height()); - addRoundedRect(rect, xRnd, yRnd, Qt::RelativeSize); -} - -/*! - \obsolete - - \fn void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, int xRnd, int yRnd); - \overload - - Adds a rectangle with rounded corners to the path. The rectangle - is constructed from \a x, \a y, and the width and height \a w - and \a h. - - The \a xRnd and \a yRnd arguments specify how rounded the corners - should be. 0 is angled corners, 99 is maximum roundedness. - - \sa addRoundedRect() - */ -void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, - int xRnd, int yRnd) -{ - addRoundedRect(QRectF(x, y, w, h), xRnd, yRnd, Qt::RelativeSize); -} - -/*! - \obsolete - - \fn bool QPainterPath::addRoundRect(qreal x, qreal y, qreal width, qreal height, int roundness); - \since 4.3 - \overload - - Adds a rounded rectangle to the path, defined by the coordinates \a - x and \a y with the specified \a width and \a height. - - The \a roundness argument specifies uniform roundness for the - rectangle. Vertical and horizontal roundness factors will be - adjusted accordingly to act uniformly around both axes. Use this - method if you want a rectangle equally rounded across both the X and - Y axis. - - \sa addRoundedRect() -*/ -void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, - int roundness) -{ - addRoundedRect(QRectF(x, y, w, h), roundness, Qt::RelativeSize); -} -#endif - /*! \since 4.3 @@ -3411,21 +3286,6 @@ QPainterPath QPainterPath::subtracted(const QPainterPath &p) const return clipper.clip(QPathClipper::BoolSub); } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \since 4.3 - \obsolete - - Use subtracted() instead. - - \sa subtracted() -*/ -QPainterPath QPainterPath::subtractedInverted(const QPainterPath &p) const -{ - return p.subtracted(*this); -} -#endif - /*! \since 4.4 diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index aa43c74bee..0b006d466c 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -142,19 +142,6 @@ public: qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize); -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") - void addRoundRect(const QRectF &rect, int xRnd, int yRnd); - QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") - void addRoundRect(qreal x, qreal y, qreal w, qreal h, - int xRnd, int yRnd); - QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") - void addRoundRect(const QRectF &rect, int roundness); - QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") - void addRoundRect(qreal x, qreal y, qreal w, qreal h, - int roundness); -#endif - void connectPath(const QPainterPath &path); bool contains(const QPointF &pt) const; @@ -196,10 +183,6 @@ public: Q_REQUIRED_RESULT QPainterPath united(const QPainterPath &r) const; Q_REQUIRED_RESULT QPainterPath intersected(const QPainterPath &r) const; Q_REQUIRED_RESULT QPainterPath subtracted(const QPainterPath &r) const; -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use r.subtracted() instead") - Q_REQUIRED_RESULT QPainterPath subtractedInverted(const QPainterPath &r) const; -#endif Q_REQUIRED_RESULT QPainterPath simplified() const; |