编译器不报错,程序能运行,但是调试到这句的时候,我看了一下变量的值,显示为<internal error>
另外,我用QImage去载入一张png图片,然后用opengl把它画在QGLWidget上,因为这internal error的原因,怎么也画不出来。
bool MainWindow::loadFile(const QString& strFileName)
{
QImage imgBuf;
if(!imgBuf.load(strFileName))
return false;
// convert imgBuf to OpenGL texture format
QImage* pImgGLTexture = new QImage(QGLWidget::convertToGLFormat(imgBuf));
// m_pImageWidget‘s destructor will delete the pointer
m_pImageWidget->setTexture(pImgGLTexture);
return true;
}