gch0214
15th May 2012, 09:16
I have a class which was inherited from QGLWidget
codes here:
class NeHeWidget : public QGLWidget
{
Q_OBJECT
public:
NeHeWidget( QWidget* parent = 0, const char* name = 0, bool fs = false );
~NeHeWidget();
protected:
void initializeGL();
void paintGL();
void resizeGL( int width, int height );
void keyPressEvent( QKeyEvent *e );
protected:
bool fullscreen;
GLfloat rTri;
GLfloat rQuad;
};
so I tried to place this OpenGl part into a window , which I can see the picture created by OpenGL on the left side , and buttons on the right side
like in this picture:
7720
I thought this class was inherited from QGLWidget
so I guess I can use this :
NeHeWidget w( 0, 0, fs );
QGraphicsScene scene;
QGraphicsProxyWidget *proxy = scene.addWidget(w,Qt::WindowFlags);
but it doesn't work.:confused:
the compiler says the error is:
expected primary-expression before ')' token
So how do I fix it?
if I didn't placed in the QGraphicsScene , it works well
or is there any way to do what was shown in the attachment?
thank you in advance!
THANKS A LOT
codes here:
class NeHeWidget : public QGLWidget
{
Q_OBJECT
public:
NeHeWidget( QWidget* parent = 0, const char* name = 0, bool fs = false );
~NeHeWidget();
protected:
void initializeGL();
void paintGL();
void resizeGL( int width, int height );
void keyPressEvent( QKeyEvent *e );
protected:
bool fullscreen;
GLfloat rTri;
GLfloat rQuad;
};
so I tried to place this OpenGl part into a window , which I can see the picture created by OpenGL on the left side , and buttons on the right side
like in this picture:
7720
I thought this class was inherited from QGLWidget
so I guess I can use this :
NeHeWidget w( 0, 0, fs );
QGraphicsScene scene;
QGraphicsProxyWidget *proxy = scene.addWidget(w,Qt::WindowFlags);
but it doesn't work.:confused:
the compiler says the error is:
expected primary-expression before ')' token
So how do I fix it?
if I didn't placed in the QGraphicsScene , it works well
or is there any way to do what was shown in the attachment?
thank you in advance!
THANKS A LOT