<?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[Need  more help with implementing for(each)]]></title><description><![CDATA[<p dir="auto">I am still lost with how to define the "for"  variable. I understand the container, but unsure  about the variable.<br />
In this  case  my container is "RemoteDevicesList" and I want to retrieve  humanly readable  items from it - address and name .</p>
<p dir="auto">Can I find  "common description" as a variable from the doc?</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/6db55797-ad15-4c85-b93b-b19fb8216671.png" alt="b010dd41-28f2-432e-b513-1d377c9f97b8-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I tried using debug  for such purpose, but was not successful finding the name for the "level". . (Does *d_otr  has a "name" ?)</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/21a10bcd-90d6-448c-9910-01fbcc730161.png" alt="a838a952-9569-49de-bcd2-e8a7bd053523-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/143070/need-more-help-with-implementing-for-each</link><generator>RSS for Node</generator><lastBuildDate>Tue, 02 Jun 2026 01:34:55 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/143070.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Feb 2023 15:58:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need  more help with implementing for(each) on Sat, 18 Feb 2023 18:09:10 GMT]]></title><description><![CDATA[<p dir="auto">@AnneRanch said in <a href="/post/748270">Need more help with implementing for(each)</a>:</p>
<blockquote>
<p dir="auto">There are TWO different QList in my snippet.  The first one  fails  as  error posted.</p>
</blockquote>
<p dir="auto">correct</p>
<blockquote>
<p dir="auto">no viable conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'QList&lt;QBluetoothDeviceInfo&gt;'<br />
QList&lt;QBluetoothDeviceInfo&gt; RemoteDevicesList_TEMP = localDevice.allDevices();</p>
</blockquote>
<p dir="auto">This warning does not come from the for() but from the assignment and I wrote what's wrong (even I only said what the compiler error already told you).</p>
]]></description><link>https://forum.qt.io/post/748273</link><guid isPermaLink="true">https://forum.qt.io/post/748273</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 18 Feb 2023 18:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to Need  more help with implementing for(each) on Sat, 18 Feb 2023 18:00:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> I am not.  Sorry, but I included code for working for(each) , There are TWO different QList in my snippet.  The first one  fails  as  error posted.</p>
]]></description><link>https://forum.qt.io/post/748270</link><guid isPermaLink="true">https://forum.qt.io/post/748270</guid><dc:creator><![CDATA[Anonymous_Banned275]]></dc:creator><pubDate>Sat, 18 Feb 2023 18:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Need  more help with implementing for(each) on Sat, 18 Feb 2023 16:51:18 GMT]]></title><description><![CDATA[<p dir="auto">When localDevice.allDevices() returns a list of QBluetoothDeviceInfo you can't store the results in a list of QBluetoothHostInfo.</p>
]]></description><link>https://forum.qt.io/post/748257</link><guid isPermaLink="true">https://forum.qt.io/post/748257</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 18 Feb 2023 16:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to Need  more help with implementing for(each) on Sat, 18 Feb 2023 16:29:05 GMT]]></title><description><![CDATA[<p dir="auto">@AnneRanch I think I got part of it</p>
<p dir="auto">RemoteDevicesList.append(info);</p>
<pre><code>QList&lt;QBluetoothDeviceInfo&gt; RemoteDevicesList_TEMP = localDevice.allDevices();
RemoteDevicesList_TEMP.append(info);

QList&lt;QBluetoothHostInfo&gt; BT_HostInfo = localDevice.allDevices();


for (auto  localDevice : RemoteDevicesList_TEMP)
{
</code></pre>
<p dir="auto">however  I am getting this weird  error - I do not get where is the</p>
<p dir="auto">QBluetoothHostInfo</p>
<p dir="auto">coming from</p>
<p dir="auto">my list is</p>
<p dir="auto">QBluetoothDeviceInfo</p>
<pre><code>/media/nov25-1/AAA_OS_RAID/RECOVERY_BACKUP_FEB17_1/RECOVERY/BLUETOOTH/SOURCE/CCC_SOURCE/terminal_SERIAL_BLUETOOTH_VER_1/terminal_SERIAL_BLUETOOTH/terminal_BLUETOOTH/mainwindow_BT_Terminal.cpp:1493: error: no viable conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'QList&lt;QBluetoothDeviceInfo&gt;'
mainwindow_BT_Terminal.cpp:1493:33: error: no viable conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'QList&lt;QBluetoothDeviceInfo&gt;'
    QList&lt;QBluetoothDeviceInfo&gt; RemoteDevicesList_TEMP = localDevice.allDevices();
                                ^                        ~~~~~~~~~~~~~~~~~~~~~~~~
/home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qlist.h:161:5: note: candidate constructor not viable: no known conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'const QList&lt;QBluetoothDeviceInfo&gt; &amp;' for 1st argument
    QList(const QList&lt;T&gt; &amp;l);
    ^
/home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qlist.h:164:12: note: candidate constructor not viable: no known conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'QList&lt;QBluetoothDeviceInfo&gt; &amp;&amp;' for 1st argument
    inline QList(QList&lt;T&gt; &amp;&amp;other) noexcept
           ^
/home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qlist.h:169:12: note: candidate constructor not viable: no known conversion from 'QList&lt;QBluetoothHostInfo&gt;' to 'std::initializer_list&lt;QBluetoothDeviceInfo&gt;' for 1st argument
    inline QList(std::initializer_list&lt;T&gt; args)
           ^
</code></pre>
]]></description><link>https://forum.qt.io/post/748255</link><guid isPermaLink="true">https://forum.qt.io/post/748255</guid><dc:creator><![CDATA[Anonymous_Banned275]]></dc:creator><pubDate>Sat, 18 Feb 2023 16:29:05 GMT</pubDate></item></channel></rss>