QOpenGLWidget.grabFramebuffer() can not work

  • I try to use grabFramebuffer() to take screen shot of QOpenGLWidget,but it can not work。 the picture i get is all grey。 can anybody help me?
    this my code:
    QImage img = ui->glwidget->grabFramebuffer();
    img.save("screen.png", "PNG");

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.