27 cout <<
"Found character in range [a-f]" << endl;
41QByteArray ba(
"We must be <b>bold</b>, very <b>bold</b>");
44 cout <<
"Found <b> tag at index position " <<
j << endl;
82 cout <<
"[" << *
data <<
"]" << endl;
218if (
url.startsWith(
"ftp:"))
224QByteArray
url(
"http://qt-project.org/doc/qt-5.0/qtdoc/index.html");
225if (
url.endsWith(
".html"))
231QByteArray
x(
"Pineapple");
310double a =
string.toDouble(&
ok);
312string =
"1234.56 Volt";
319float a =
string.toFloat(&
ok);
321string =
"1234.56 Volt";
359 static const char mydata[] = {
360 '\x00',
'\x00',
'\x03',
'\x84',
'\x78',
'\x9c',
'\x3b',
'\x76',
361 '\xec',
'\x18',
'\xc3',
'\x31',
'\x0a',
'\xf1',
'\xcc',
'\x99',
427const char cart[] = {
'c',
'a',
'\0',
'r',
'\0',
't'};
440macAddress.
toHex(
':');
466emscripten::val uint8array = emscripten::val::global(
"g_uint8array");
467QByteArray byteArray = QByteArray::fromEcmaUint8Array(uint8array);
472emscripten::val uint8array = QByteArray::toEcmaUint8Array(byteArray);
QByteArray trimmed() const &
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
QByteArray repeated(qsizetype times) const
QByteArray & fill(char c, qsizetype size=-1)
Sets every byte in the byte array to ch.
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
static QByteArray fromHex(const QByteArray &hexEncoded)
Returns a decoded copy of the hex encoded array hexEncoded.
QByteArray last(qsizetype n) const
QByteArray simplified() const &
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QByteArray toUpper() const &
QByteArray & setNum(short, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent='%')
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void chop(qsizetype n)
Removes n bytes from the end of the byte array.
void truncate(qsizetype pos)
Truncates the byte array at index position pos.
QByteArray percentDecoded(char percent='%') const
static QByteArray fromBase64(const QByteArray &base64, Base64Options options=Base64Encoding)
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
QByteArray & insert(qsizetype i, QByteArrayView data)
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
QByteArray sliced(qsizetype pos) const
QByteArray first(qsizetype n) const
QByteArray leftJustified(qsizetype width, char fill=' ', bool truncate=false) const
Returns a byte array of size width that contains this byte array padded with the fill byte.
QByteArray toLower() const &
QByteArray rightJustified(qsizetype width, char fill=' ', bool truncate=false) const
Returns a byte array of size width that contains the fill byte followed by this byte array.
qsizetype lastIndexOf(char c, qsizetype from=-1) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray & remove(qsizetype index, qsizetype len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
bool isNull() const noexcept
Returns true if this byte array is null; otherwise returns false.
static FromBase64Result fromBase64Encoding(QByteArray &&base64, Base64Options options=Base64Encoding)
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
QByteArray & replace(qsizetype index, qsizetype len, const char *s, qsizetype alen)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
double toDouble(bool *ok=nullptr) const
Returns the string converted to a double value.
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
qsizetype size() const
Returns the number of characters in this string.
long toLong(bool *ok=nullptr, int base=10) const
Returns the string converted to a long using base base, which is 10 by default and must be between 2 ...
float toFloat(bool *ok=nullptr) const
Returns the string converted to a float value.
QByteArray toLocal8Bit() const &
QChar * data()
Returns a pointer to the data stored in the QString.
#define QByteArrayLiteral(str)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * string
[0]
QUrl url("example.com")
[constructor-url-reference]