consider that I have the following two widgets:
Q_OBJECT
public:
CRayProfileWidget
(QWidget *parent
= 0);
QSize minimumSizeHint
() { }
}
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
};
class CRayProfileWidget : public QGLWidget {
Q_OBJECT
public:
CRayProfileWidget(QWidget *parent = 0);
QSize minimumSizeHint() {
return QSize(256, 128);
}
QSize sizeHint() {
return QSize(256, 128);
}
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
};
To copy to clipboard, switch view to plain text mode
and the second one is exactly the same except the name
class CRayProfileWidget2
: public QGLWidget {
Q_OBJECT
public:
CRayProfileWidget2
(QWidget *parent
= 0);
QSize minimumSizeHint
() { }
}
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
};
class CRayProfileWidget2 : public QGLWidget {
Q_OBJECT
public:
CRayProfileWidget2(QWidget *parent = 0);
QSize minimumSizeHint() {
return QSize(256, 128);
}
QSize sizeHint() {
return QSize(256, 128);
}
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
};
To copy to clipboard, switch view to plain text mode
and the main window containing both of these widgets is like:
///////////////////////////////////////
// main window
Q_OBJECT
public:
}
};
///////////////////////////////////////
// main window
class Window : public QWidget {
Q_OBJECT
public:
Window(QWidget *parent = 0);
QSize sizeHint() const {
return QSize(800, 950);
}
};
To copy to clipboard, switch view to plain text mode
both of the above widgets have a seperate rendering context. I want that they both share the same OpenGL rendering context.
how can I do that?
thanks in advance
Bookmarks