<?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[Asynchronous event with QtConcurrent]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I wanted to run a asynchronous event on my samson app (I wanted to make the molecule vibrate and still be able to use something else).<br />
I did it using QtConcurrent tools, for this I had to change the content of CMakeLists.txt to add QtConcurrent library. It compiles fine but now my app is not visible anymore in SAMSON Debug. Is it because I changed  CMakeLists.txt?<br />
Thanks in advance</p>
]]></description><link>https://forum.samson-connect.net/topic/87/asynchronous-event-with-qtconcurrent</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 05:26:42 GMT</lastBuildDate><atom:link href="https://forum.samson-connect.net/topic/87.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Feb 2019 10:25:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Asynchronous event with QtConcurrent on Fri, 08 Feb 2019 08:01:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi Stephane,</p>
<p dir="auto">thanks for your answer, I'll do that then.</p>
<p dir="auto">Best</p>
<p dir="auto">Laëtitia</p>
]]></description><link>https://forum.samson-connect.net/post/399</link><guid isPermaLink="true">https://forum.samson-connect.net/post/399</guid><dc:creator><![CDATA[Laëtitia]]></dc:creator><pubDate>Fri, 08 Feb 2019 08:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Asynchronous event with QtConcurrent on Mon, 04 Feb 2019 17:08:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi Laetitia,</p>
<p dir="auto">for efficiency reasons, the data graph is not thread-safe, so there might be issues when modifying the document from several distincts threads (e.g. in the history). So, when we want to do this type of things, we use a <code>QTimer</code>.</p>
<p dir="auto">For example you declare in a header a <code>QTimer</code>:</p>
<pre><code>QTimer animationTimer;
</code></pre>
<p dir="auto">and a slot:</p>
<pre><code>public slots:
    void animate();
</code></pre>
<p dir="auto">and in your source code (for example in the constructor), you connect the timer to a slot that will perform one update of the system:</p>
<pre><code>connect(&amp;animationTimer, SIGNAL(timeout()), this, SLOT(animate()));
animationTimer.setSingleShot(false); // make it repetitive
</code></pre>
<p dir="auto">Then, when you want to start the animation you do:</p>
<pre><code>animationTimer.start(20); // every 20 milliseconds
</code></pre>
<p dir="auto">And when you want to stop the animation you do:</p>
<pre><code>animationTimer.stop();
</code></pre>
<p dir="auto">In your <code>animate()</code> slot, you perform one step of the vibration. The <code>QTimer</code> will intersperse calls to your  <code>animate()</code> function as regularly as possible, and SAMSON will still be able to process other events (keyboard, mouse, etc.).</p>
<p dir="auto">Hope this helps,</p>
<p dir="auto">Stephane</p>
]]></description><link>https://forum.samson-connect.net/post/391</link><guid isPermaLink="true">https://forum.samson-connect.net/post/391</guid><dc:creator><![CDATA[Stephane]]></dc:creator><pubDate>Mon, 04 Feb 2019 17:08:39 GMT</pubDate></item></channel></rss>