<?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[Bug in the Mandelbrot example?]]></title><description><![CDATA[<p dir="auto">In <a href="https://doc.qt.io/qt-6/qtcore-threads-mandelbrot-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qtcore-threads-mandelbrot-example.html</a> it says:</p>
<pre><code>If we discover inside the loop that restart has been set to true (by render()), we break out of the loop immediately, so that the control quickly returns to the very top of the outer loop (the forever loop) and we fetch the new rendering parameters.
</code></pre>
<p dir="auto">However when I look the code I see the break is:</p>
<pre><code>void RenderThread::run()
{
    forever {
        //    ...
        while (pass &lt; NumPasses) {
            // ...
            for (int y = -halfHeight; y &lt; halfHeight; ++y) {
                if (restart)
                    break;
</code></pre>
<p dir="auto">The <code>break</code> will break the for loop but not he while loop.  I don't see anything that breaks the while loop to "quickly return" to the forever loop.</p>
<p dir="auto">Am I missing something or is this a bug?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/145256/bug-in-the-mandelbrot-example</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 22:43:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145256.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 May 2023 05:17:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bug in the Mandelbrot example? on Wed, 24 May 2023 05:11:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maliberty">@<bdi>maliberty</bdi></a> said in <a href="/post/758861">Bug in the Mandelbrot example?</a>:</p>
<blockquote>
<p dir="auto">we break out of the loop immediately</p>
</blockquote>
<p dir="auto">So not "immediately" but quickly enough.</p>
]]></description><link>https://forum.qt.io/post/759125</link><guid isPermaLink="true">https://forum.qt.io/post/759125</guid><dc:creator><![CDATA[maliberty]]></dc:creator><pubDate>Wed, 24 May 2023 05:11:53 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in the Mandelbrot example? on Sun, 21 May 2023 07:01:12 GMT]]></title><description><![CDATA[<p dir="auto">You did not post the whole code. After the if() statement pass is increased so the while loop is ready very quickly and it returns to the forever()</p>
<p dir="auto">Not optimal but also not really a problem.</p>
]]></description><link>https://forum.qt.io/post/758864</link><guid isPermaLink="true">https://forum.qt.io/post/758864</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sun, 21 May 2023 07:01:12 GMT</pubDate></item></channel></rss>