glutz
glutz

Reputation: 1959

How does QGLWidget work in QT?

Amazingly, i switched a QWidget to be a QGLWidget and now my QPainter::drawImage calls are 5x faster. I changed nothing else, except the widget type. How does that make QPainter calls perform better? I'm glad it works, but i just do not understand how. Any ideas?

Thanks.

Upvotes: 1

Views: 993

Answers (3)

Luca Carlon
Luca Carlon

Reputation: 9996

The QGLWidget uses the OpenGL implementation you have available on your system, which may be hardware accelerated. It depends on your system. Qt widgets can be rendered using different QPaintEngine's. You can even try to change the entire graphics system to use OpenGL by trying to run an application with the parameter -graphicssystem. This cannot be done currently in Qt for Linux Embedded. You can try the difference running the animatedtiles example for instance. Note that this doesn't necessarily mean performance will be better than with the raster painter. It depends on the OpenGL implementation of the system, if it is only software, performance may be even worst.

Upvotes: 2

SystemRaen
SystemRaen

Reputation: 855

If it's using OpenGL, it's probably also using hardware acceleration

Upvotes: 0

Dotti
Dotti

Reputation: 791

It uses OpenGL for rendering its content.

Upvotes: 0

Related Questions