Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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