Obsolete Members for QByteArray

以下成員源於類 QByteArray 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(obsolete) operator const char * () const
(obsolete) operator const void * () const

成員函數文檔編製

QByteArray:: operator const char * () const

Returns a pointer to the data stored in the byte array. The pointer can be used to access the bytes that compose the array. The data is '\0'-terminated. The pointer remains valid as long as the array isn't reallocated or destroyed.

This operator is mostly useful to pass a byte array to a function that accepts a const char * .

可以禁用此運算符通過定義 QT_NO_CAST_FROM_BYTEARRAY 當編譯應用程序時。

注意: QByteArray 可以存儲任何字節值 (包括 \0),但大多數函數需要 char * 自變量,假定數據在遇到首個 \0 時結束。

另請參閱 constData ().

QByteArray:: operator const void * () const

Returns a pointer to the data stored in the byte array. The pointer can be used to access the bytes that compose the array. The data is '\0'-terminated. The pointer remains valid as long as the array isn't reallocated or destroyed.

This operator is mostly useful to pass a byte array to a function that accepts a const char * .

可以禁用此運算符通過定義 QT_NO_CAST_FROM_BYTEARRAY 當編譯應用程序時。

注意: QByteArray 可以存儲任何字節值 (包括 \0),但大多數函數需要 char * 自變量,假定數據在遇到首個 \0 時結束。

另請參閱 constData ().