[Interest] Calculate FPS with QGLWidget - paintGL() is not called
Till Oliver Knoll
till.oliver.knoll at gmail.com
Fri Feb 10 16:20:23 CET 2012
Am 10.02.2012 um 08:56 schrieb Dietrich.Gossen at continental-corporation.com:
> Hi,
>
> I am trying to calculate the fps of my application. I know in general how to do it, but my implemented QGLWidget doesn’t work properly. The paintGL() Method doesn’t get called.
> ...
> And that’s my main.cpp
>
> int main(int argc, char *argv[])
> {
> QApplication a(argc, argv);
>
> QGraphicsScene scene
>
>
> QGraphicsView view(&scene);
>
> GLWidget *gl = new GLWidget();
>
> view.setViewport(gl);
> view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
>
> view.show();
>
> return a.exec();
> }
Is this your actual code? Because you don't add any items to your scene, so there is nothing to paint!
So I guess Qt just clears the background, but doesn't bother calling the QGLWidget's paint method.
Cheers, Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120210/621fd534/attachment.html>
More information about the Interest
mailing list