PDA

View Full Version : QGLWidget : changing anti aliasing during run time



pl01
27th July 2011, 11:43
Hi,

I have anti-aliasing in my QGLWidget, I set it the following way :


GLViewport(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) ...


Later I try to change the format this way:


QGLFormat currentFormat = format();
currentFormat.setSampleBuffers(true);
currentFormat.setSamples(0);
setFormat(currentFormat);


It has 2 effects :

1) it does not work
2) the mouse event are never called after this change !

Does someone have an idea ?

pl01
28th July 2011, 15:32
Nobody know ?

Dong Back Kim
4th August 2011, 08:51
Hi,

I have anti-aliasing in my QGLWidget, I set it the following way :


GLViewport(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) ...


Later I try to change the format this way:


QGLFormat currentFormat = format();
currentFormat.setSampleBuffers(true);
currentFormat.setSamples(0);
setFormat(currentFormat);


It has 2 effects :

1) it does not work
2) the mouse event are never called after this change !

Does someone have an idea ?

Hi,

When you said "it does not work", you mean multisampling is not working or something else?

The mouse event part is also bit weird. I don't think they are related each other, are they?
Try to use setMouseTracking(true) within the GLViewport.

Regards,
Dong Back Kim