Qt OpenGL: Assertion Failed When Closing Window



  • Hi,

    I'm writing a graphics program in Qt with OpenGL. When I try to close the program, there is a debug error says:

    bq. Program: [directory of my program]
    Module: 4.7.2
    File: global\qglobal.cpp
    Line: 2262
    ASSERT: "group->context() == q_ptr" in file .\qgl.cpp, line 1657

    This error even occurs when I just close the example program (chap20\tetrahedron) of book "C++ GUI Programming with Qt 4, Second Edition".
    I'm using VS 2010 on Win 7 64bit, could anyone help me on this? Thanks.



  • Hi,

    as mentioned "here":http://www.qtcentre.org/threads/50560-Qt-OpenGL-Assertion-Failed-When-Close-the-Window it has something to do with the format set in the constructor. When I remove it, the program doesn't crash anymore but it only shows the legend and the background. So this doesn't really fix the problem...

    @
    OpenGlViewer::OpenGlViewer(QWidget *parent): QGLWidget(parent)
    {
    this->setFormat(QGLFormat(QGL::SampleBuffers));
    }
    @


Log in to reply
 

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