Compile with QT_ENABLE_DEPRECATED_BEFORE set to old version of Qt
authorOlivier Goffart <ogoffart@kde.org>
Wed, 26 Oct 2011 18:24:26 +0000 (20:24 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 27 Oct 2011 11:32:16 +0000 (13:32 +0200)
Change-Id: Ice67071cc97ad645a7dda264a3dce184fceae75a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/image/qimage.h
src/gui/image/qpixmap.h

index 7e8a0a2..6f070bc 100644 (file)
@@ -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<QImageTextKeyLang> 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
 
index 5d300d1..b67eb0f 100644 (file)
@@ -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