diff options
Diffstat (limited to 'src/gui/image/qimage.h')
-rw-r--r-- | src/gui/image/qimage.h | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 7b2abfaf85..35dc41be2d 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -50,10 +50,6 @@ #include <QtCore/qrect.h> #include <QtCore/qstring.h> -#if QT_DEPRECATED_SINCE(5, 0) -#include <QtCore/qstringlist.h> -#endif - #if defined(Q_OS_DARWIN) || defined(Q_QDOC) Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGImage); #endif @@ -68,31 +64,9 @@ class QMatrix; class QStringList; class QTransform; class QVariant; -template <class T> class QList; template <class T> class QVector; struct QImageData; -class QImageDataMisc; // internal -#if QT_DEPRECATED_SINCE(5, 0) -class QImageTextKeyLang { -public: - QT_DEPRECATED QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } - QT_DEPRECATED QImageTextKeyLang() { } - - QByteArray key; - QByteArray lang; - - bool operator< (const QImageTextKeyLang& other) const - { return key < other.key || (key==other.key && lang < other.lang); } - bool operator== (const QImageTextKeyLang& other) const - { return key==other.key && lang==other.lang; } - inline bool operator!= (const QImageTextKeyLang &other) const - { return !operator==(other); } -private: - friend class QImage; - QImageTextKeyLang(bool /*dummy*/) {} -}; -#endif typedef void (*QImageCleanupFunction)(void*); @@ -179,7 +153,6 @@ public: Format format() const; -#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QIMAGE_COMPAT_CPP) Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & { return convertToFormat_helper(f, flags); } Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && @@ -189,9 +162,6 @@ public: else return convertToFormat_helper(f, flags); } -#else - Q_REQUIRED_RESULT QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const; -#endif Q_REQUIRED_RESULT QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const; bool reinterpretAsFormat(Format f); @@ -217,19 +187,12 @@ public: const uchar *bits() const; const uchar *constBits() const; -#if QT_DEPRECATED_SINCE(5, 10) - QT_DEPRECATED_X("Use sizeInBytes") int byteCount() const; -#endif qsizetype sizeInBytes() const; uchar *scanLine(int); const uchar *scanLine(int) const; const uchar *constScanLine(int) const; -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) qsizetype bytesPerLine() const; -#else - int bytesPerLine() const; -#endif bool valid(int x, int y) const; bool valid(const QPoint &pt) const; @@ -250,11 +213,7 @@ public: void setPixelColor(const QPoint &pt, const QColor &c); QVector<QRgb> colorTable() const; -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) void setColorTable(const QVector<QRgb> &colors); -#else - void setColorTable(const QVector<QRgb> colors); -#endif qreal devicePixelRatio() const; void setDevicePixelRatio(qreal scaleFactor); @@ -290,7 +249,6 @@ public: #endif // QT_DEPRECATED_SINCE(5, 15) QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const; static QTransform trueMatrix(const QTransform &, int w, int h); -#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QIMAGE_COMPAT_CPP) QImage mirrored(bool horizontally = false, bool vertically = true) const & { return mirrored_helper(horizontally, vertically); } QImage &&mirrored(bool horizontally = false, bool vertically = true) && @@ -299,10 +257,6 @@ public: { return rgbSwapped_helper(); } QImage &&rgbSwapped() && { rgbSwapped_inplace(); return std::move(*this); } -#else - QImage mirrored(bool horizontally = false, bool vertically = true) const; - QImage rgbSwapped() const; -#endif void invertPixels(InvertMode = InvertRgb); QColorSpace colorSpace() const; @@ -325,9 +279,6 @@ public: inline static QImage fromData(const QByteArray &data, const char *format = nullptr) { return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); } -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; } -#endif qint64 cacheKey() const; QPaintEngine *paintEngine() const override; @@ -353,20 +304,6 @@ public: CGImageRef toCGImage() const Q_DECL_CF_RETURNS_RETAINED; #endif -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED inline QString text(const char *key, const char *lang = nullptr) const; - QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const; - QT_DEPRECATED inline QStringList textLanguages() const; - QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const; - QT_DEPRECATED inline void setText(const char* key, const char* lang, const QString&); -#endif - -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED inline int numColors() const; - QT_DEPRECATED inline void setNumColors(int); - QT_DEPRECATED inline int numBytes() const; -#endif - protected: virtual int metric(PaintDeviceMetric metric) const override; QImage mirrored_helper(bool horizontal, bool vertical) const; @@ -401,99 +338,6 @@ inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt. inline QColor QImage::pixelColor(const QPoint &pt) const { return pixelColor(pt.x(), pt.y()); } inline void QImage::setPixelColor(const QPoint &pt, const QColor &c) { setPixelColor(pt.x(), pt.y(), c); } -#if QT_DEPRECATED_SINCE(5, 0) - -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -inline QString QImage::text(const char* key, const char* lang) const -{ - if (!d) - return QString(); - QString k = QString::fromLatin1(key); - if (lang && *lang) - k += QLatin1Char('/') + QString::fromLatin1(lang); - return text(k); -} - -inline QList<QImageTextKeyLang> QImage::textList() const -{ - QList<QImageTextKeyLang> imageTextKeys; - if (!d) - return imageTextKeys; - QStringList keys = textKeys(); - for (int i = 0; i < keys.size(); ++i) { - int index = keys.at(i).indexOf(QLatin1Char('/')); - if (index > 0) { - QImageTextKeyLang tkl(true); - tkl.key = keys.at(i).left(index).toLatin1(); - tkl.lang = keys.at(i).mid(index+1).toLatin1(); - imageTextKeys += tkl; - } - } - - return imageTextKeys; -} - -inline QStringList QImage::textLanguages() const -{ - if (!d) - return QStringList(); - QStringList keys = textKeys(); - QStringList languages; - for (int i = 0; i < keys.size(); ++i) { - int index = keys.at(i).indexOf(QLatin1Char('/')); - if (index > 0) - languages += keys.at(i).mid(index+1); - } - - return languages; -} - -inline QString QImage::text(const QImageTextKeyLang&kl) const -{ - if (!d) - return QString(); - QString k = QString::fromLatin1(kl.key.constData()); - if (!kl.lang.isEmpty()) - k += QLatin1Char('/') + QString::fromLatin1(kl.lang.constData()); - return text(k); -} - -inline void QImage::setText(const char* key, const char* lang, const QString &s) -{ - if (!d) - return; - detach(); - - // In case detach() ran out of memory - if (!d) - return; - - QString k = QString::fromLatin1(key); - if (lang && *lang) - k += QLatin1Char('/') + QString::fromLatin1(lang); - setText(k, s); -} - -QT_WARNING_POP - -inline int QImage::numColors() const -{ - return colorCount(); -} - -inline void QImage::setNumColors(int n) -{ - setColorCount(n); -} - -inline int QImage::numBytes() const -{ - return int(sizeInBytes()); -} -#endif - // QImage stream functions #if !defined(QT_NO_DATASTREAM) |