Details
-
Suggestion
-
Resolution: Out of scope
-
P2: Important
-
None
-
None
Description
A property in QGLWidget that would make all calls to the paintGL, initializeGL etc functions be executed by an explicitly created render thread, ie
QThread *thread = new QThread;
MyGLWidget *widget = new MyGLWidget(thread);
widget->setRenderThread(thread);
widget->show();
thread->start();
In QGLWidget::setRenderThread:
void QGLWidget::setRenderThread(QThread *thread)
{
d->thread = thread;
d->renderHelper = new QGLRenderHelper(this);
d->renderhelper->moveToThread(d->thread);
}
QGLRenderHelper then implements slots that are called by QGLWidget via QMetaObject::invokeMethod instead of QGLWidget::paintGL etc, and call the QGLWidget::paintGL etc functions.