QtGui: mark some image functions as obsolete
Mark functions which were obsolete since Qt4 times as deprecated so they can be removed with Qt6: - QBitmap::transformed(QMatrix) - QImageIOHandler::name() - QImageWriter::setDescription() - QImageWriter::description() - QPixmap::fill() - QPixmap::grabWindow() - QPixmap::grabWidget() - QTransform::det() Change-Id: I8523065eb59a3242c4c4c195f31ae15c4dcbf8f7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
8f65160c44
commit
f9e6f8efda
@ -310,6 +310,7 @@ QBitmap QBitmap::transformed(const QTransform &matrix) const
|
||||
return bm;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\overload
|
||||
\obsolete
|
||||
@ -321,5 +322,6 @@ QBitmap QBitmap::transformed(const QMatrix &matrix) const
|
||||
{
|
||||
return transformed(QTransform(matrix));
|
||||
}
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -76,7 +76,10 @@ public:
|
||||
static QBitmap fromData(const QSize &size, const uchar *bits,
|
||||
QImage::Format monoFormat = QImage::Format_MonoLSB);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QBitmap::transformed(QTransform) instead")
|
||||
QBitmap transformed(const QMatrix &) const;
|
||||
#endif
|
||||
QBitmap transformed(const QTransform &matrix) const;
|
||||
|
||||
typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr;
|
||||
|
@ -416,6 +416,7 @@ QByteArray QImageIOHandler::format() const
|
||||
\sa read(), QIODevice::peek()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
@ -426,6 +427,7 @@ QByteArray QImageIOHandler::name() const
|
||||
{
|
||||
return format();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Writes the image \a image to the assigned device. Returns \c true on
|
||||
|
@ -69,7 +69,10 @@ public:
|
||||
void setFormat(const QByteArray &format) const;
|
||||
QByteArray format() const;
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QImageIOHandler::format() instead")
|
||||
virtual QByteArray name() const;
|
||||
#endif
|
||||
|
||||
virtual bool canRead() const = 0;
|
||||
virtual bool read(QImage *image) = 0;
|
||||
|
@ -648,6 +648,7 @@ QImageIOHandler::Transformations QImageWriter::transformation() const
|
||||
return d->transformation;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
@ -679,6 +680,7 @@ QString QImageWriter::description() const
|
||||
{
|
||||
return d->description;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\since 4.1
|
||||
|
@ -100,9 +100,12 @@ public:
|
||||
QImageIOHandler::Transformations transformation() const;
|
||||
void setTransformation(QImageIOHandler::Transformations orientation);
|
||||
|
||||
// Obsolete as of 4.1
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QImageWriter::setText() instead")
|
||||
void setDescription(const QString &description);
|
||||
QT_DEPRECATED_X("Use QImageReader::text() instead")
|
||||
QString description() const;
|
||||
#endif
|
||||
|
||||
void setText(const QString &key, const QString &text);
|
||||
|
||||
|
@ -856,6 +856,7 @@ bool QPixmap::doImageIO(QImageWriter *writer, int quality) const
|
||||
}
|
||||
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
@ -876,6 +877,14 @@ void QPixmap::fill(const QPaintDevice *device, const QPoint &p)
|
||||
|
||||
Use QPainter or the fill(QColor) overload instead.
|
||||
*/
|
||||
void QPixmap::fill(const QPaintDevice *device, int xofs, int yofs)
|
||||
{
|
||||
Q_UNUSED(device)
|
||||
Q_UNUSED(xofs)
|
||||
Q_UNUSED(yofs)
|
||||
qWarning("this function is deprecated, ignored");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
@ -959,6 +968,7 @@ static void sendResizeEvents(QWidget *target)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
@ -982,6 +992,11 @@ QPixmap QPixmap::grabWidget(QObject *widget, const QRect &rectangle)
|
||||
|
||||
Use QWidget::grab() instead.
|
||||
*/
|
||||
QPixmap QPixmap::grabWidget(QObject *widget, int x, int y, int w, int h)
|
||||
{
|
||||
return grabWidget(widget, QRect(x, y, w, h));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
QPixmap stream functions
|
||||
@ -1578,6 +1593,7 @@ QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionF
|
||||
return QPixmap(data.take());
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QPixmap QPixmap::grabWindow(WId window, int x, int y, int
|
||||
width, int height)
|
||||
@ -1631,6 +1647,7 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
|
||||
" Defaulting to primary screen.");
|
||||
return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
@ -94,8 +94,12 @@ public:
|
||||
static int defaultDepth();
|
||||
|
||||
void fill(const QColor &fillColor = Qt::white);
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X(" Use QPainter or the fill(QColor)")
|
||||
void fill(const QPaintDevice *device, const QPoint &ofs);
|
||||
inline void fill(const QPaintDevice *device, int xofs, int yofs) { fill(device, QPoint(xofs, yofs)); }
|
||||
QT_DEPRECATED_X(" Use QPainter or the fill(QColor)")
|
||||
void fill(const QPaintDevice *device, int xofs, int yofs);
|
||||
#endif
|
||||
|
||||
QBitmap mask() const;
|
||||
void setMask(const QBitmap &);
|
||||
@ -111,10 +115,14 @@ public:
|
||||
#endif
|
||||
QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode = Qt::MaskInColor) const;
|
||||
|
||||
static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1);
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QScreen::grabWindow() instead")
|
||||
static QPixmap grabWindow(WId, int x = 0, int y = 0, int w = -1, int h = -1);
|
||||
QT_DEPRECATED_X("Use QWidget::grab() instead")
|
||||
static QPixmap grabWidget(QObject *widget, const QRect &rect);
|
||||
static inline QPixmap grabWidget(QObject *widget, int x=0, int y=0, int w=-1, int h=-1)
|
||||
{ return grabWidget(widget, QRect(x, y, w, h)); }
|
||||
QT_DEPRECATED_X("Use QWidget::grab() instead")
|
||||
static QPixmap grabWidget(QObject *widget, int x = 0, int y = 0, int w = -1, int h = -1);
|
||||
#endif
|
||||
|
||||
inline QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
|
||||
Qt::TransformationMode mode = Qt::FastTransformation) const
|
||||
|
@ -2144,13 +2144,14 @@ QTransform::operator QVariant() const
|
||||
\sa inverted()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn qreal QTransform::det() const
|
||||
\obsolete
|
||||
|
||||
Returns the matrix's determinant. Use determinant() instead.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn qreal QTransform::m11() const
|
||||
|
@ -98,7 +98,10 @@ public:
|
||||
TransformationType type() const;
|
||||
|
||||
inline qreal determinant() const;
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use determinant() instead")
|
||||
qreal det() const;
|
||||
#endif
|
||||
|
||||
qreal m11() const;
|
||||
qreal m12() const;
|
||||
|
@ -1556,7 +1556,7 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadGlyphSet(const QTransform &matrix)
|
||||
gs = &transformedGlyphSets[0];
|
||||
gs->clear();
|
||||
gs->transformationMatrix = m;
|
||||
gs->outline_drawing = fontDef.pixelSize * fontDef.pixelSize * qAbs(matrix.det()) > QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE;
|
||||
gs->outline_drawing = fontDef.pixelSize * fontDef.pixelSize * qAbs(matrix.determinant()) > QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE;
|
||||
}
|
||||
Q_ASSERT(gs != 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user