[Qt-interest] Problem with QGLWidget

shariff shariff at mic.co.in
Wed May 20 08:43:41 CEST 2009


Dear All,

I wrote a program using QT-OpenGL (Linux) to display an image in window with some effects.
While Iam running the code Iam getting segmentation fault. Can any one tell me what the exact problem is?

My code is follows.....


class GLWidget : public QGLWidget
      {
          public:
                            
                GLWidget(QGLContext *con);
                ~GLWidget();
      }

GLWidget::GLWidget(QGLContext *cont)
     {
    cont->create();   //=====> At this point Iam getting segmentation fault
    }

int main(int argc,char *argv[])
    {
      QApplication app(argc,argv);
      QGLContext *context;
      QGLFormat format;
      context=new QGLContext(format);
      GLWidget *glw=new GLWidget(context);
      glw->show();
      return app.exec();
    }

Thanks in advance

-Shariff
Confidentiality NoticeThe information contained in this Electronic Message 
and any ATTACHMENTs to this message are intended for the EXCLUSIVE USE of 
the ADDRESSEE(s) and may contain CONFIDENTIAL or PRIVILEGED information. 
If you are not the intended recipient, please notify the SENDER at MIC or
itsupport at mic.co.in immediately and DESTROY all copies of this message 
and any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090520/fcd0ed0f/attachment.html 


More information about the Qt-interest-old mailing list