scarecr0w132
9th December 2013, 04:39
I am trying to integrate this:
http://doc.qt.digia.com/qq/qq26-openglcanvas.html
But I want to use a third party library that does the rendering.
The class that currently renders is derived from QGLWidget.
This is how it currently draws:
void occView::paintEvent( QPaintEvent* e )
{
aView->Redraw();
}
My current code:
myOccView = new occView(myContext, this);
GraphicsView *view = new GraphicsView();
view->setViewport(myOccView);
view->setViewportUpdateMode(QGraphicsView::FullViewportU pdate);
view->setScene(new OpenGLScene);
view->resize(1024, 768);
view->show();
this results in http://postimg.org/image/wl7fd315t/
You can also see that they are in different windows.
QWindowsGLContext::makeCurrent: SetPixelFormat() failed (The pixel format is invalid.)
ASSERT: "context" in file opengl\qopenglfunctions.cpp, line 194
qwidget::repaint: recursive repaint detected
So I am obviously doing something wrong..
Do I have to redraw it in
QGraphicScene::DrawBackground
Thank you
http://doc.qt.digia.com/qq/qq26-openglcanvas.html
But I want to use a third party library that does the rendering.
The class that currently renders is derived from QGLWidget.
This is how it currently draws:
void occView::paintEvent( QPaintEvent* e )
{
aView->Redraw();
}
My current code:
myOccView = new occView(myContext, this);
GraphicsView *view = new GraphicsView();
view->setViewport(myOccView);
view->setViewportUpdateMode(QGraphicsView::FullViewportU pdate);
view->setScene(new OpenGLScene);
view->resize(1024, 768);
view->show();
this results in http://postimg.org/image/wl7fd315t/
You can also see that they are in different windows.
QWindowsGLContext::makeCurrent: SetPixelFormat() failed (The pixel format is invalid.)
ASSERT: "context" in file opengl\qopenglfunctions.cpp, line 194
qwidget::repaint: recursive repaint detected
So I am obviously doing something wrong..
Do I have to redraw it in
QGraphicScene::DrawBackground
Thank you