[Interest] How to share QOpenGLContext between multiple QQuickRenderControl?

黃柏鈞 kiyo7777 at gmail.com
Tue Jul 7 15:13:44 CEST 2015


Hi,

I'm trying to use QQuickRenderControl to render QML offscreen and generate
texture. I started with the QQuickRenderControl example, everything works
fine until I try to add more QQuickRenderControl to render different QML.
The exception happened when I initialize the second QQuickRenderControl:


*ASSERT: "!context->property(QSG_RENDERCONTEXT_PROPERTY).isValid()" in file
scenegraph\qsgcontext.cpp, line 648*

After some search on web, I found the code in *qsgcontext.cpp*:




*if (m_attachToGLContext) {
Q_ASSERT(!context->property(QSG_RENDERCONTEXT_PROPERTY).isValid());
context->setProperty(QSG_RENDERCONTEXT_PROPERTY,
QVariant::fromValue(this)); }*
Is there a way to share QOpenGLContext between multiple
QQuickRenderControl? Although I could create a QOpenGLContext for each
QQuickRenderControl and it works, but creating that many contexts on same
thread doesn't make sense.

Regards,
Jarvis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150707/26ad4388/attachment.html>


More information about the Interest mailing list