From 181df199d31a8018cfcfc31b548909fe4b57ccbd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 3 May 2011 22:37:25 +0200 Subject: remove more QT3_SUPPORT code --- src/gui/image/qimage.h | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'src/gui/image/qimage.h') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 496fe93c54..849f731f5e 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -283,50 +283,6 @@ public: void setText(const char* key, const char* lang, const QString&); #endif -#ifdef QT3_SUPPORT - enum Endian { BigEndian, LittleEndian, IgnoreEndian }; - QT3_SUPPORT_CONSTRUCTOR QImage(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian); - QT3_SUPPORT_CONSTRUCTOR QImage(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian); - QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, const QRgb *colortable, int numColors, Endian bitOrder); -#ifdef Q_WS_QWS - QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, int pbl, const QRgb *colortable, int numColors, Endian bitOrder); -#endif - inline QT3_SUPPORT Endian bitOrder() const { - Format f = format(); - return f == Format_Mono ? BigEndian : (f == Format_MonoLSB ? LittleEndian : IgnoreEndian); - } - QT3_SUPPORT QImage convertDepth(int, Qt::ImageConversionFlags flags = Qt::AutoColor) const; - QT3_SUPPORT QImage convertDepthWithPalette(int, QRgb* p, int pc, Qt::ImageConversionFlags flags = Qt::AutoColor) const; - QT3_SUPPORT QImage convertBitOrder(Endian) const; - QT3_SUPPORT bool hasAlphaBuffer() const; - QT3_SUPPORT void setAlphaBuffer(bool); - QT3_SUPPORT uchar **jumpTable(); - QT3_SUPPORT const uchar * const *jumpTable() const; - inline QT3_SUPPORT void reset() { *this = QImage(); } - static inline QT3_SUPPORT Endian systemByteOrder() - { return QSysInfo::ByteOrder == QSysInfo::BigEndian ? BigEndian : LittleEndian; } - inline QT3_SUPPORT QImage swapRGB() const { return rgbSwapped(); } - inline QT3_SUPPORT QImage mirror(bool horizontally = false, bool vertically = true) const - { return mirrored(horizontally, vertically); } - QT3_SUPPORT bool create(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian); - QT3_SUPPORT bool create(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian); - inline QT3_SUPPORT QImage xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); } - inline QT3_SUPPORT QImage smoothScale(int w, int h, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const - { return scaled(QSize(w, h), mode, Qt::SmoothTransformation); } - inline QImage QT3_SUPPORT smoothScale(const QSize &s, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const - { return scaled(s, mode, Qt::SmoothTransformation); } - inline QT3_SUPPORT QImage scaleWidth(int w) const { return scaledToWidth(w); } - inline QT3_SUPPORT QImage scaleHeight(int h) const { return scaledToHeight(h); } - inline QT3_SUPPORT void invertPixels(bool invertAlpha) { invertAlpha ? invertPixels(InvertRgba) : invertPixels(InvertRgb); } - inline QT3_SUPPORT QImage copy(int x, int y, int w, int h, Qt::ImageConversionFlags) const - { return copy(QRect(x, y, w, h)); } - inline QT3_SUPPORT QImage copy(const QRect &rect, Qt::ImageConversionFlags) const - { return copy(rect); } - static QT3_SUPPORT Endian systemBitOrder(); - inline QT3_SUPPORT_CONSTRUCTOR QImage(const QByteArray &data) - { d = 0; *this = QImage::fromData(data); } -#endif - protected: virtual int metric(PaintDeviceMetric metric) const; @@ -362,11 +318,6 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QImage &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QImage &); #endif -#ifdef QT3_SUPPORT -Q_GUI_EXPORT QT3_SUPPORT void bitBlt(QImage* dst, int dx, int dy, const QImage* src, - int sx=0, int sy=0, int sw=-1, int sh=-1, Qt::ImageConversionFlags flags = Qt::AutoColor); -#endif - QT_END_NAMESPACE QT_END_HEADER -- cgit v1.2.3 From 004700532ab635cf8e5240c5674b2aaeeb601b95 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 May 2011 12:14:17 +0200 Subject: remove constructor --- src/gui/image/qimage.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/gui/image/qimage.h') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 849f731f5e..91a6a99a2a 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -132,9 +132,6 @@ public: explicit QImage(const char * const xpm[]); #endif explicit QImage(const QString &fileName, const char *format = 0); -#ifndef QT_NO_CAST_FROM_ASCII - explicit QImage(const char *fileName, const char *format = 0); -#endif QImage(const QImage &); ~QImage(); -- cgit v1.2.3 From bc0a0281d535079745ed1544a063571b86ca718e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Jul 2011 09:49:12 +0200 Subject: Get rid of some obsolete functions in QImage / QPixmap / QPixmapData. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0d2412c9196475b926a17de9fcc3281f6625fae0 Reviewed-on: http://codereview.qt.nokia.com/1733 Reviewed-by: Qt Sanity Bot Reviewed-by: Olivier Goffart Reviewed-by: Jørgen Lind --- src/gui/image/qimage.h | 119 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 15 deletions(-) (limited to 'src/gui/image/qimage.h') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 59997dc114..c5168faaa3 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -66,6 +66,7 @@ template class QVector; struct QImageData; class QImageDataMisc; // internal #ifndef QT_NO_IMAGE_TEXT +#if QT_DEPRECATED_SINCE(5, 0) class Q_GUI_EXPORT QImageTextKeyLang { public: QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } @@ -81,6 +82,7 @@ public: inline bool operator!= (const QImageTextKeyLang &other) const { return !operator==(other); } }; +#endif #endif //QT_NO_IMAGE_TEXT @@ -168,17 +170,11 @@ public: QRect rect() const; int depth() const; -#ifdef QT_DEPRECATED - QT_DEPRECATED int numColors() const; -#endif int colorCount() const; int bitPlaneCount() const; QRgb color(int i) const; void setColor(int i, QRgb c); -#ifdef QT_DEPRECATED - QT_DEPRECATED void setNumColors(int); -#endif void setColorCount(int); bool allGray() const; @@ -187,9 +183,7 @@ public: uchar *bits(); const uchar *bits() const; const uchar *constBits() const; -#ifdef QT_DEPRECATED - QT_DEPRECATED int numBytes() const; -#endif + int byteCount() const; uchar *scanLine(int); @@ -272,12 +266,19 @@ public: QString text(const QString &key = QString()) const; void setText(const QString &key, const QString &value); - // The following functions are obsolete as of 4.1 - QString text(const char* key, const char* lang=0) const; - QList textList() const; - QStringList textLanguages() const; - QString text(const QImageTextKeyLang&) const; - void setText(const char* key, const char* lang, const QString&); +#if QT_DEPRECATED_SINCE(5, 0) + inline QString text(const char* key, const char* lang=0) const; + inline QList textList() const; + inline QStringList textLanguages() const; + inline QString text(const QImageTextKeyLang&) const; + inline void setText(const char* key, const char* lang, const QString&); +#endif +#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: @@ -308,6 +309,94 @@ Q_GUI_EXPORT_INLINE int QImage::pixelIndex(const QPoint &pt) const { return pixe Q_GUI_EXPORT_INLINE QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); } Q_GUI_EXPORT_INLINE void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); } +#if QT_DEPRECATED_SINCE(5, 0) +#ifndef QT_NO_IMAGE_TEXT +inline QString QImage::text(const char* key, const char* lang) const +{ + if (!d) + return QString(); + QString k = QString::fromAscii(key); + if (lang && *lang) + k += QLatin1Char('/') + QString::fromAscii(lang); + return d->text.value(k); +} + +inline QList QImage::textList() const +{ + QList 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; + tkl.key = keys.at(i).left(index).toAscii(); + tkl.lang = keys.at(i).mid(index+1).toAscii(); + 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&) const +{ + if (!d) + return QString(); + QString k = QString::fromAscii(kl.key); + if (!kl.lang.isEmpty()) + k += QLatin1Char('/') + QString::fromAscii(kl.lang); + return d->text.value(k); +} + +inline void QImage::setText(const char* key, const char* lang, const QString&) +{ + if (!d) + return; + detach(); + + // In case detach() ran out of memory + if (!d) + return; + + QString k = QString::fromAscii(key); + if (lang && *lang) + k += QLatin1Char('/') + QString::fromAscii(lang); + d->text.insert(k, s); +} +#endif +inline int QImage::numColors() const +{ + return d ? d->colortable.size() : 0; +} + +inline void QImage::setNumColors(int) +{ + setColorCount(numColors); +} + +inline int QImage::numBytes() const +{ + return d ? d->nbytes : 0; +} +#endif + // QImage stream functions #if !defined(QT_NO_DATASTREAM) -- cgit v1.2.3 From 310519d6d11da546b23c1cba307f37c24e0a5c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 15 Jul 2011 14:07:12 +0200 Subject: Rename QPixmapData to QPlatformPixmap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes the API symmetric with the other Lighthouse APIs. Change-Id: I8a399f3c968ea35d4624711b31f2ac5bb94b7893 Reviewed-on: http://codereview.qt.nokia.com/1735 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/gui/image/qimage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/image/qimage.h') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index c5168faaa3..7e8a0a28e8 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -288,8 +288,8 @@ private: friend class QWSOnScreenSurface; QImageData *d; - friend class QRasterPixmapData; - friend class QBlittablePixmapData; + friend class QRasterPlatformPixmap; + friend class QBlittablePlatformPixmap; friend class QPixmapCacheEntry; friend Q_GUI_EXPORT qint64 qt_image_id(const QImage &image); friend const QVector *qt_image_colortable(const QImage &image); -- cgit v1.2.3