View Full Version : Qt ARGB and RGBA

18th January 2010, 12:21

I want to know why Qt uses a ARGB model, and not the RGBA to store images..

I mean when qt want to send data to openGL they have to use the RGBA model.
So that is an unnecessary step.

19th January 2010, 21:44
QImage can store an arbitrary number of formats and so can OpenGL. Use for example GL_ABGR_EXT to upload a texture in ABGR-mode. OpenGL is one of the many things that Qt can address but Qt was not written with the sole purpose of utilizing OpenGL. There is for sure a reason to do it this way and not the other way around.

If you use GLuint QGLWidget::bindTexture ( const QImage & image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA ), you give Qt the chance to optimize uploads of textures. Maybe there is no unnecessary step in this case.