<?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[Qt 5: Error : cannot make OpenGL Context current in a different thread]]></title><description><![CDATA[<p dir="auto">Hi<br />
(Sorry for my poor English Speaking)<br />
I use Ubuntu.<br />
First, I run "this code":<a href="http://mih.voxindeserto.de/_static/threaded_cube-gcc4-qt4.tar.gz" target="_blank" rel="noopener noreferrer nofollow ugc">http://mih.voxindeserto.de/_static/threaded_cube-gcc4-qt4.tar.gz</a>  in qt4 and it was ok!<br />
Now, when (after modify it's Include Classes for Qt5) I run it under Qt 5, there's this runtime Error: <em>cannot make OpenGL Context current in a different thread</em><br />
I thinks the problem is around the makeCurrent() function and "this link":<a href="http://qt-project.org/doc/qt-5.0/qtopengl/qglcontext.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.0/qtopengl/qglcontext.html</a> says :"If you call this( makeCurrent() ) from a thread other than the main UI thread, make sure you've first pushed the context to the relevant thread from the UI thread using moveToThread()."<br />
The Problem is that I don't know where i should put the "moveToThread()" function (in general or in this example).<br />
Help me plz :-(</p>
]]></description><link>https://forum.qt.io/topic/29993/qt-5-error-cannot-make-opengl-context-current-in-a-different-thread</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 12:42:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/29993.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Jul 2013 10:10:07 GMT</pubDate><ttl>60</ttl></channel></rss>