<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to write the data from QTVector 3D into 3 Arrays (Qbytearray x; Qbytearray y;Qbytearray z;)]]></title><description><![CDATA[<p dir="auto">Good day</p>
<p dir="auto">I am having a problem understanding QTVector3D .<br />
Below is a snipped from the QTLabs Sensehat module for Raspberry Pi. The example works perfectly .<br />
I would like to send the data via Serial or UDP and therefore would like to Write the x,y,z values from QVector3D into 3 Arrays so i can send them. My problem is i don't know how i can split "v" into 3 arrays ?</p>
<p dir="auto">Qbytearray X;<br />
Qbytearray Y;<br />
Qbytearray Z;</p>
<p dir="auto">myarray.append(v); does obviously not work</p>
<p dir="auto">How would i do that ? I could not</p>
<pre><code>QObject::connect(&amp;sensors, &amp;QSenseHatSensors::gyroChanged, [](const QVector3D &amp;v) {
    qDebug() &lt;&lt; "Gyro:" &lt;&lt; v;
});
</code></pre>
<p dir="auto">Hope someone can help me</p>
]]></description><link>https://forum.qt.io/topic/87353/how-to-write-the-data-from-qtvector-3d-into-3-arrays-qbytearray-x-qbytearray-y-qbytearray-z</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 03:57:59 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/87353.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Feb 2018 06:38:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to write the data from QTVector 3D into 3 Arrays (Qbytearray x; Qbytearray y;Qbytearray z;) on Thu, 01 Feb 2018 08:55:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/markus-ippy">@<bdi>Markus-Ippy</bdi></a></p>
<pre><code>QDataStream xStream(&amp;X, QIODevice::WriteOnly);
xStream &lt;&lt; v.x();
</code></pre>
<p dir="auto">Same for Y and Z.</p>
]]></description><link>https://forum.qt.io/post/439667</link><guid isPermaLink="true">https://forum.qt.io/post/439667</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 01 Feb 2018 08:55:46 GMT</pubDate></item></channel></rss>