Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved QQuickWidget - QOpenGLFramebufferObject::release() called from incompatible context

    QML and Qt Quick
    1
    1
    81
    Loading More Posts
    • 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.
    • A
      aatwo last edited by aatwo

      Hi all.

      I am trying to render a QQuickWidget (which contains a QML application) to an offscreen surface which I am rendering to a surface in my game. However I am encountering the following warning contantly and my application is leaking memory very quickly:

      QOpenGLFramebufferObject::release() called from incompatible context
      

      This is strange because if I swap the QQuickWidget for any normal QWidget derrived class (e.g. a QDial) I get absolutely no warnings / memory leakage.

      Does anyone have any idea why this is happening?

      My code looks roughly like this:

      // Variable types defined in header
      QOpenGLContext* openGLContext;
      QGraphicsScene* graphicsScene;
      QOpenGLFramebufferObject* openGLFrameBuffer;
      QOffscreenSurface* offscreenSurface ;
      
      // Render loop
      void Render()
      {
          openGLContext->makeCurrent( offscreenSurface );
          openGLFrameBuffer->bind();
      
          QOpenGLPaintDevice device( openGLFrameBuffer->size() );
          QPainter painter( &device );
          graphicsScene->render( &painter );
      
          openGLFrameBuffer->release();
      
          GLuint unTexture = openGLFrameBuffer->texture();
      
          ...
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post