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:
{
aView->Redraw();
}
void occView::paintEvent( QPaintEvent* e )
{
aView->Redraw();
}
To copy to clipboard, switch view to plain text mode
My current code:
myOccView = new occView(myContext, this);
GraphicsView *view = new GraphicsView();
view->setViewport(myOccView);
view->setScene(new OpenGLScene);
view->resize(1024, 768);
view->show();
myOccView = new occView(myContext, this);
GraphicsView *view = new GraphicsView();
view->setViewport(myOccView);
view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
view->setScene(new OpenGLScene);
view->resize(1024, 768);
view->show();
To copy to clipboard, switch view to plain text mode
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
QWindowsGLContext::makeCurrent: SetPixelFormat() failed (The pixel format is invalid.)
ASSERT: "context" in file opengl\qopenglfunctions.cpp, line 194
qwidget::repaint: recursive repaint detected
To copy to clipboard, switch view to plain text mode
So I am obviously doing something wrong..
Do I have to redraw it in
QGraphicScene::DrawBackground
QGraphicScene::DrawBackground
To copy to clipboard, switch view to plain text mode
Thank you
Bookmarks