Qt OpenGL project[SOLVED]
-
Yes, it is a common qt widget project. For doing this you have to create your own QGLWidget class, which heritates QGLWidget and declare the 3 virtual functions:
- void initializeGL();
- void paintGL();
- void resizeGL(int , int );
I am working an Qt OpenGL project right now. Here you have a class example from my program:
@class QOpenGL : public QGLWidget {
Q_OBJECT// OPENGL FUNCTIONS
void initializeGL();
void paintGL();
void resizeGL(int , int );
// MOUSE CONTROL FUNCTIONS
void mousePressEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);public:
// CONSTRUCTOR
explicit QOpenGL(QWidget *parent = 0);
~QOpenGL() { doneCurrent(); }
};@
You can see in fact that the QGLWidget is a child class of QWidget. On my example I re-implemented the mouse functions (from QWidget) in order to have control on mouse input. You can see Qt Help for more info.Cheers!