I have 2 custom widgets inheriting from QGLWidget and I aim to show the same scene from 2 different views using these widgets. For this I share the first widget with the second widget. However this requires a custom constructor than the compiled UI file provides. Such as
// The line I mention from Compiled UI file
widget_2 = new SideGlWidget(widget);
// What I actually want this line to be
widget_2 = new SideGlWidget(widget, MainScreen);
Some suggests to set such additional parameters later using an init function. Then how do I set shareWidget member of QGLWidget? here is the contructor of SideGlWidget
SideGlWidget::SideGlWidget(QWidget *parent,QGLWidget * shareWidget)
: QGLWidget(parent,shareWidget)
{
}
Any comments and edits are welcome.