<?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[MultiThreaded GUI application]]></title><description><![CDATA[<p dir="auto">Hi All,<br />
Im getting an error like XLib:sequence Failed, X Error: BadAccess X Error: BadLenght<br />
and some times QGLContext:makecurrent Failed.And all these problems raised after introducing the threads. In above mentioned error list some of them ll rise because if we are trying to do some GUI related operation in the worker thread other then Main GUI thread,but in my case im doing all GUI related operation in Main thread only.But still… Can some one help me to solve these problems.<br />
Thank U.</p>
<p dir="auto">[<em>Moved to General and Desktop since more people are going to see it there, Tobias</em>]</p>
]]></description><link>https://forum.qt.io/topic/9514/multithreaded-gui-application</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 23:17:12 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/9514.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Sep 2011 06:16:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MultiThreaded GUI application on Fri, 16 Sep 2011 10:45:50 GMT]]></title><description><![CDATA[<p dir="auto">Ya im confirm about that. Problem is coming when i do PixelBuffer makecurrent(). This is the piece of code whr im getting problem:</p>
<p dir="auto">@<br />
flushData()<br />
{<br />
pixelBuffer-&gt;makeCurrent();<br />
glClearColor(0.5,0.5,0.5,255);<br />
glClear(GL_COLOR_BUFFER_BIT);<br />
}<br />
@<br />
Where pixelBuffer is the QGLPixelBuffer object.</p>
<p dir="auto">And following where im initalizing my QGLWidget:<br />
@<br />
setWidget(QWidget* w)<br />
{<br />
if( QGLPixelBuffer::hasOpenGLPbuffers() )<br />
{<br />
QGLWidget* glw = qobject_cast&lt;QGLWidget*&gt;(w);<br />
if( glw )<br />
{<br />
QGLFormatformat(QGL::Rgba|QGL::AlphaChannel,1);//<br />
pixelBuffer = new QGLPixelBuffer(d-&gt;size, d-&gt;size,  format, glw);</p>
<pre><code>    }
    else
        pixmap = new QPixmap(d-&gt;size, d-&gt;size);
}
else
    pixmap = new QPixmap(d-&gt;size, d-&gt;size);

// Now initialize the paint device
if(pixelBuffer)
{
    pixelBuffer-&gt;makeCurrent();
    glViewport(0, 0, d-&gt;size, d-&gt;size);
   glClearColor(0.5,0.5,0.5,255);
    glClear(GL_COLOR_BUFFER_BIT);

    textureId = pixelBuffer-&gt;generateDynamicTexture();
</code></pre>
<p dir="auto">#ifndef Q_WS_X11<br />
pixelBuffer-&gt;bindToDynamicTexture(textureId);<br />
#else<br />
pixelBuffer-&gt;updateDynamicTexture(textureId);<br />
#endif</p>
<pre><code>    ((QGLWidget*)(w))-&gt;makeCurrent();

    dataPaintDevice = pixelBuffer;
</code></pre>
<p dir="auto">}<br />
@<br />
And one more thing that flushData() function if i call initially then no problem but after when start to read the data from the socket then problem ll rise.</p>
<p dir="auto">Edit: please use @ tags to delimit code blocks to make it more readable [ZapB]</p>
]]></description><link>https://forum.qt.io/post/109612</link><guid isPermaLink="true">https://forum.qt.io/post/109612</guid><dc:creator><![CDATA[suma]]></dc:creator><pubDate>Fri, 16 Sep 2011 10:45:50 GMT</pubDate></item><item><title><![CDATA[Reply to MultiThreaded GUI application on Fri, 16 Sep 2011 10:03:21 GMT]]></title><description><![CDATA[<p dir="auto">Check that you function calls and signal/slot connections are <em>really</em> triggering all your GUI operations to happen in the main thread.</p>
]]></description><link>https://forum.qt.io/post/109590</link><guid isPermaLink="true">https://forum.qt.io/post/109590</guid><dc:creator><![CDATA[ZapB]]></dc:creator><pubDate>Fri, 16 Sep 2011 10:03:21 GMT</pubDate></item><item><title><![CDATA[Reply to MultiThreaded GUI application on Thu, 15 Sep 2011 07:52:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi, Thanks..Actually this is quiet bit big application so i myself don't know which portion of code is raising the problem,but i can explain what im doing.<br />
In socket im receiving the data which is thread and some calculation im doing in separate thread and painting is done in some other class which is there in main thread.<br />
Previously it was working fine but data reception is very fast and data was skipping so i introduced thread for receiving as well as for doing calculation <a href="http://also.So" target="_blank" rel="noopener noreferrer nofollow ugc">also.So</a> started to get errors like as shown above. Something like :<br />
XLib: Unexpected async reply after sometime it gives<br />
XLib:Sequence failed something like this.</p>
]]></description><link>https://forum.qt.io/post/109390</link><guid isPermaLink="true">https://forum.qt.io/post/109390</guid><dc:creator><![CDATA[suma]]></dc:creator><pubDate>Thu, 15 Sep 2011 07:52:09 GMT</pubDate></item><item><title><![CDATA[Reply to MultiThreaded GUI application on Thu, 15 Sep 2011 06:54:30 GMT]]></title><description><![CDATA[<p dir="auto">It is really heard to say anything from this information.<br />
Do you have some example code? small test app that shows (only) the problem?</p>
]]></description><link>https://forum.qt.io/post/109371</link><guid isPermaLink="true">https://forum.qt.io/post/109371</guid><dc:creator><![CDATA[giesbert]]></dc:creator><pubDate>Thu, 15 Sep 2011 06:54:30 GMT</pubDate></item></channel></rss>