From cd1e62ffc121cc68c5a133a8095d431f04d966ce Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 15 Mar 2012 17:47:31 +0100 Subject: [PATCH] Undeprecate operator casts on QByteArray. This reverts part of commit 8397a44bedf542b53284674c87268819f4911d31. Change-Id: I1d2ec018167faeb23a9343b209bb0ff2d8db311d Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/tools/qbytearray.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index e65a920..bd3a4a8 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -205,10 +205,8 @@ public: void squeeze(); #ifndef QT_NO_CAST_FROM_BYTEARRAY -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED operator const char *() const { return constData(); } - QT_DEPRECATED operator const void *() const { return constData(); } -#endif + operator const char *() const; + operator const void *() const; #endif char *data(); const char *data() const; @@ -415,6 +413,12 @@ inline char QByteArray::operator[](uint i) const inline bool QByteArray::isEmpty() const { return d->size == 0; } +#ifndef QT_NO_CAST_FROM_BYTEARRAY +inline QByteArray::operator const char *() const +{ return d->data(); } +inline QByteArray::operator const void *() const +{ return d->data(); } +#endif inline char *QByteArray::data() { detach(); return d->data(); } inline const char *QByteArray::data() const -- 2.7.4