I'm trying to convert an int to QByteArray
. I'm using this method QByteArray::number(m_vman);
is it correct?
I'm trying to use the number()
for getting an int to QByteArray
.
I'm trying the following code but the bytearray is zero
QByteArray vmanByteArray, vheaterByteArray;
QDataStream streamVMan(&vmanByteArray, QIODevice::WriteOnly);
QDataStream streamVHeater(&vheaterByteArray, QIODevice::WriteOnly);
streamVMan << m_vman;
streamVHeater << m_vheater;
QByteArray arr = m_htman ? vmanByteArray : vheaterByteArray;