<?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[Send variable value from .cpp to .qml]]></title><description><![CDATA[<p dir="auto">Hello, I am collecting information from a gps (longitude and latitude) without problems. I represent this information in an lcdNumber, but I also want to send it to a .qml file to represent it in a map. After some tests I have not succeeded. Is there any simple way to do this? Do you have information about it?</p>
<p dir="auto">I am new to using qt and qml.</p>
<p dir="auto">Best regards</p>
]]></description><link>https://forum.qt.io/topic/140399/send-variable-value-from-cpp-to-qml</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 06:13:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140399.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Oct 2022 10:56:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Thu, 10 Nov 2022 07:02:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/d4n1">@<bdi>d4n1</bdi></a> said in <a href="/post/735567">Send variable value from .cpp to .qml</a>:</p>
<blockquote>
<p dir="auto">connect(this, SIGNAL(&lt;function_name&gt;(QVariant)), obj, SLOT(&lt;function_name&gt;(QVariant)));</p>
</blockquote>
<p dir="auto">Just a suggestion: you should switch to Qt5 connect syntax. It has one important advantage: if you do something wrong you will get compiler error during the build instead of a warning during application runtime.</p>
]]></description><link>https://forum.qt.io/post/735599</link><guid isPermaLink="true">https://forum.qt.io/post/735599</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 10 Nov 2022 07:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Wed, 09 Nov 2022 18:40:11 GMT]]></title><description><![CDATA[<p dir="auto">Thanks to all, finally including in the .cpp,</p>
<pre><code>    connect(this, SIGNAL(&lt;function_name&gt;(QVariant)), obj, SLOT(&lt;function_name&gt;(QVariant)));
</code></pre>
<p dir="auto">works.</p>
<p dir="auto">I have put the headers in the .h and defined the operation in the .qml.</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.qt.io/post/735567</link><guid isPermaLink="true">https://forum.qt.io/post/735567</guid><dc:creator><![CDATA[d4n1]]></dc:creator><pubDate>Wed, 09 Nov 2022 18:40:11 GMT</pubDate></item><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Wed, 02 Nov 2022 19:58:53 GMT]]></title><description><![CDATA[<p dir="auto">one way to do it as follows:<br />
m_qmlAppEngine-&gt;rootContext()-&gt;setContextProperty( "lcdNumber",  new lcdNumber() /* your class instance*/);<br />
define the properties with signal for example longitudeChanged() in lcdNumber and you can use lcdNumber in any qml file</p>
]]></description><link>https://forum.qt.io/post/734864</link><guid isPermaLink="true">https://forum.qt.io/post/734864</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Wed, 02 Nov 2022 19:58:53 GMT</pubDate></item><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Wed, 02 Nov 2022 19:40:08 GMT]]></title><description><![CDATA[<p dir="auto">Can you show what your .pro file looks like ?</p>
]]></description><link>https://forum.qt.io/post/734857</link><guid isPermaLink="true">https://forum.qt.io/post/734857</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 02 Nov 2022 19:40:08 GMT</pubDate></item><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Wed, 02 Nov 2022 18:08:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi, I try but it doesn't work (QT 5.15.1 and MSVC2019).<br />
The error: module "io.qt.examples.backend" is not installed.<br />
I have tried some solutions that I have found without success. It seems to me that from version 5.15 that example should work.</p>
]]></description><link>https://forum.qt.io/post/734852</link><guid isPermaLink="true">https://forum.qt.io/post/734852</guid><dc:creator><![CDATA[d4n1]]></dc:creator><pubDate>Wed, 02 Nov 2022 18:08:02 GMT</pubDate></item><item><title><![CDATA[Reply to Send variable value from .cpp to .qml on Sat, 29 Oct 2022 18:44:48 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">There's a whole <a href="https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html" target="_blank" rel="noopener noreferrer nofollow ugc">chapter</a> dedicated to that in the documentation. It should help you get started.</p>
]]></description><link>https://forum.qt.io/post/734484</link><guid isPermaLink="true">https://forum.qt.io/post/734484</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 29 Oct 2022 18:44:48 GMT</pubDate></item></channel></rss>