Home > Mobile >  About QOpenGLContext
About QOpenGLContext

Time:12-29

Using multi-threaded rendering QOpenGLWidget, complains always make a QOpenGLContext current in a company's thread, to crash the program,

CodePudding user response:

QOpenGLWidget can only work in the main thread, the thread can be used to process the data, and send the results through the signal channel to the main thread

CodePudding user response:

I have multiple QOpenGLWidget controls the main thread of the need to show the update at the same time, the main thread to deal with other things, so I'd like to open a thread to render,

CodePudding user response:

GUI thread and worker thread
As mentioned above, each program has a thread on startup, the thread is called "the main thread" (in Qt applications, also known as "GUI thread"), Qt GUI must run in this thread, all widgets and several related classes, such as QPixmap, cannot work in a worker thread, auxiliary thread is often referred to as "worker thread", because it is used to share the work from the main thread,
  •  Tags:  
  • Qt
  • Related