Using QByteArray: Difference between revisions
Jump to navigation
Jump to search
AutoSpider (talk | contribs) (Convert ExpressionEngine section headers) |
AutoSpider (talk | contribs) m (AutoSpider moved page UsingQByteArray to Using QByteArray: Title formats) |
(No difference)
|
Revision as of 03:46, 12 April 2015
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
Introduction
QByteArray is the Qt class to store a array of bytes. It is analogous to a char *. Unlike a QString, a QByteArray has no encoding information and makes no attempt to decode bytes into characters.
Converting QByteArray to QString
To convert a QByteArray to QString, one needs to specify the encoding. It is not possible to convert a QByteArray to QString without knowing the encoding. Once the encoding is known, one can use functions like QString::fromUtf8, QString::fromUcs4 or use QTextCodec::toUnicode().
QByteArray::fromRawData()
No copy. Copies point to raw data.