[Qt-interest] When OpenGL Initialization happens? (QGraphicsScene - OpenGL glBegin/glEnd)
fungos
fungos at gmail.com
Fri Apr 17 01:24:21 CEST 2009
Ouch... I see now. I have wrapped it in a library some time ago and
have forgotten about its existence :S
Thank you Samuel, looks like everything is working now!
On Thu, Apr 16, 2009 at 5:28 AM, Samuel Rødal <sroedal at trolltech.com> wrote:
> fungos wrote:
>>
>> Ok, but when we use _only_ QGraphicsView + QGraphicsScene, it does use
>> QGLWidget internally? How can I then call makeCurrent when holding
>> only QGraphicsView and/or QGraphicsScene?
>
> If you want QGraphicsView to render using OpenGL you need to explicitly call
> QGraphicsView::setViewport() with a QGLWidget, like this:
>
> QGraphicsView view;
>
> ...
>
> QGLWidget *widget = new QGLWidget;
> view.setViewport(widget);
>
> And then you can do widget->makeCurrent() and do the initialization that you
> require.
>
> I suggest you read this Qt Quarterly article for more information on how to
> mix OpenGL and QGraphicsView:
>
> http://doc.trolltech.com/qq/qq26-openglcanvas.html
>
> --
> Samuel
>
--
Animal Frontline Liberation
More information about the Qt-interest-old
mailing list