Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5: Error : cannot make OpenGL Context current in a different thread

Qt 5: Error : cannot make OpenGL Context current in a different thread

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1 Offline
    1 Offline
    1313
    wrote on last edited by
    #1

    Hi
    (Sorry for my poor English Speaking)
    I use Ubuntu.
    First, I run "this code":http://mih.voxindeserto.de/_static/threaded_cube-gcc4-qt4.tar.gz in qt4 and it was ok!
    Now, when (after modify it's Include Classes for Qt5) I run it under Qt 5, there's this runtime Error: cannot make OpenGL Context current in a different thread
    I thinks the problem is around the makeCurrent() function and "this link":http://qt-project.org/doc/qt-5.0/qtopengl/qglcontext.html 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()."
    The Problem is that I don't know where i should put the "moveToThread()" function (in general or in this example).
    Help me plz :-(

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved