From 104f8671ff018f5191a6f7e6d7f147f6449ee3a4 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 26 Oct 2011 20:24:26 +0200 Subject: Compile with QT_ENABLE_DEPRECATED_BEFORE set to old version of Qt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ice67071cc97ad645a7dda264a3dce184fceae75a Reviewed-by: Samuel Rødal --- src/gui/image/qimage.h | 18 +++++++++--------- src/gui/image/qpixmap.h | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 7e8a0a28e8..6f070bc44d 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -318,7 +318,7 @@ inline QString QImage::text(const char* key, const char* lang) const QString k = QString::fromAscii(key); if (lang && *lang) k += QLatin1Char('/') + QString::fromAscii(lang); - return d->text.value(k); + return text(k); } inline QList QImage::textList() const @@ -355,17 +355,17 @@ inline QStringList QImage::textLanguages() const return languages; } -inline QString QImage::text(const QImageTextKeyLang&) const +inline QString QImage::text(const QImageTextKeyLang&kl) 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); + return text(k); } -inline void QImage::setText(const char* key, const char* lang, const QString&) +inline void QImage::setText(const char* key, const char* lang, const QString &s) { if (!d) return; @@ -378,22 +378,22 @@ inline void QImage::setText(const char* key, const char* lang, const QString&) QString k = QString::fromAscii(key); if (lang && *lang) k += QLatin1Char('/') + QString::fromAscii(lang); - d->text.insert(k, s); + setText(k, s); } #endif inline int QImage::numColors() const { - return d ? d->colortable.size() : 0; + return colorCount(); } -inline void QImage::setNumColors(int) +inline void QImage::setNumColors(int n) { - setColorCount(numColors); + setColorCount(n); } inline int QImage::numBytes() const { - return d ? d->nbytes : 0; + return byteCount(); } #endif diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 5d300d1f76..b67eb0fdb2 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -218,15 +218,14 @@ inline bool QPixmap::loadFromData(const QByteArray &buf, const char *format, #if QT_DEPRECATED_SINCE(5, 0) inline QPixmap QPixmap::alphaChannel() const { - return toImage().alphaChannel(); + return QPixmap::fromImage(toImage().alphaChannel()); } inline void QPixmap::setAlphaChannel(const QPixmap &p) { - detach(); - QImage image = data->toImage(); + QImage image = toImage(); image.setAlphaChannel(p.toImage()); - data->fromImage(image); + *this = QPixmap::fromImage(image); } #endif -- cgit v1.2.3