View Full Version : set attributes to the customized QGLWidget class

22nd February 2012, 21:23
Hello forum,

I am trying to convert WxWidget application to the Qt application and i have to set some attributes to the particular QGLWidget subclass.

The attributes that need to be set are as follows:

QGLFormat glformat;

attributeList[0] = QGL::Rgba;
attributeList[1] = QGL::DoubleBuffer;
attributeList[2] = glformat.depthBufferSize();
attributeList[3] = 24;
attributeList[4] = glformat.stencilBufferSize();
attributeList[5] = 8;

if(stereo_mode == RenderMode::QUAD_BUFFERED_STEREO)
attributeList[6] = QGL::StereoBuffers;

attributeList[7] = 0;

In the WxWidget they are sending the whole array to wxGLCanvas constructor and i do not see any provision to do the same here in Qt.

Even inside the constructor i can have them as an array and then i am not sure what to do.

Any better idea to deal with this issue?