<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
In the following (C++) structure the <b>buff </b>shall be sent as
a byte array<br>
<br>
struct XX<br>
{<br>
QString xxx;<br>
int yyy;<br>
char <b>buff</b>[4];<br>
}<br>
<br>
In Qt I have to declare metatype <br>
Q_DECLARE_METATYPE( XX )<br>
<br>
and "<<", ">>" operators<br>
<br>
how to declare these operators, so that the <b>buff</b> will be
sent as a byte array and not an ordinary string ('\0's inside
possible)<br>
<br>
I don't think <br>
....<br>
argument << mystruct.xxx<br>
<< mystruct.yyy<br>
<< mystruct<b>.buff </b>;<br>
<br>
will be correct in this case. <br>
<br>
I've also been thinking to use the structure with QByteArray
instead of <b>buff. </b>Is it feasible?<br>
e.g construct the QByteArray using fromRawData(buff,4) just
before sending. <br>
<br>
How to do this same using low-level API?<br>
<br>
I suppose the signature will be something like (sia(yyyy)), and I
have to send all bytes separately, or there is a better way to do it<br>
<br>
How to receive this byte array ( there is nothing like "toRawData()"
) ?<br>
<br>
Thanks for your help<br>
<br>
bogdan<br>
<br>
<br>
<br>
</body>
</html>