[Interest] QGraphicsView widget vs opengl viewport

Calogero Mauceri mauceri at actgate.com
Tue Nov 27 15:36:31 CET 2012


Hi,

In my application I have a QGrapricsScene with a big amount of polygon 
items in it (more than 50,000 QGraphicsPolygonItem).

I found out in the documentation that it is possible to set a QGLWidget 
as the viewport of the QGraphicsView.

"By default, QGraphicsView provides a regularQWidget 
<http://qt-project.org/doc/qt-4.8/qwidget.html>for the viewport widget. 
You can access this widget by callingviewport 
<http://qt-project.org/doc/qt-4.8/qabstractscrollarea.html#viewport>(), 
or you can replace it by callingsetViewport 
<http://qt-project.org/doc/qt-4.8/qabstractscrollarea.html#setViewport>(). 
To render using OpenGL, simply call setViewport(newQGLWidget 
<http://qt-project.org/doc/qt-4.8/qglwidget.html>)."

As far as I understand that should work out of the box, without any 
additional code. The system should use automatically opengl rendering 
from now on.
My question is, can my QGraphicsScene benefit of the OpenGL rendering? 
Do you think I should always enable it? Are there some cases where the 
classic widget viewport can work better?
Is the QGraphicsScene OpenGL rendering well supported on multiple 
platforms (Win, linux, Mac)?

I'm using Qt 4.8.3.

Thanks in advance for your advice,
     Calogero

-- 
Calogero Mauceri
Software Engineer

Applied Coherent Technology Corporation (ACT)
www.actgate.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121127/c200175f/attachment.html>


More information about the Interest mailing list