hi all, sorry, still pretty new to qt ...
can't find any example on how to share the context between two QGLWidgets.
It's mentioned everywhere, that this should be possible, but i can't get it to work.
what i've tried so far:
this gives me an "invalid conversion from 'const QGLContext*' to 'QGLContext*'" in the hw=... line
{
glw = new GLWidget(this);
hw = new HiddenWidget(glw->context(), this, glw);
...
}
{
...
}
{
...
}
Widget::Widget(QWidget *parent) : QWidget(parent)
{
glw = new GLWidget(this);
hw = new HiddenWidget(glw->context(), this, glw);
...
}
HiddenWidget::HiddenWidget(QGLContext *contxt, QWidget *parent, QGLWidget *shared) : QGLWidget(contxt, parent, shared)
{
...
}
GLWidget::GLWidget(QWidget *parent) : QGLWidget(parent)
{
...
}
To copy to clipboard, switch view to plain text mode
i've also tried something like
QGLFormat format;
QGLContext *contxt;
contxt=new QGLContext(format);
To copy to clipboard, switch view to plain text mode
in the Widget class constructor and pass that to another constructor for GLWidget and to HiddenWidget, but that didn't work either, and i wouldn't know where and when to assign the context to whom ...
glw = new GLWidget(contxt, this, NULL);
hw = new HiddenWidget(contxt, this, glw);
{
}
glw = new GLWidget(contxt, this, NULL);
hw = new HiddenWidget(contxt, this, glw);
GLWidget::GLWidget(QGLContext *contxt, QWidget *parent, QGLWidget *shared) : QGLWidget(contxt, parent, shared)
{
}
To copy to clipboard, switch view to plain text mode
thanks for help,
oliver
Bookmarks