4

I have a QDockWidget that contains a QOpenGLWidget inside it. I'm trying to set up AA in the GL viewport, but nothing I tried so far worked.

Right now I'm trying to set up the surface format in the widget's constructor, like so:

QSurfaceFormat format;
format.setRenderableType(QSurfaceFormat::OpenGL);
format.setProfile(QSurfaceFormat::CoreProfile);
format.setVersion(4, 1);    
format.setSamples(16);
setFormat(format);

Then, in the initializeGL function, I've added the line glEnable(GL_MULTISAMPLE); However, it doesn't work. No Anti-Aliasing. I tried several other approaches, including creating the GL context myself and setting the format on it or setting up application flags and the default surface format, but none of them worked either.

I'm quite at a loss here, and I'm probably missing something simple since the consensus points to format.setSamples(16); as the crucial element, but as I said, it doesn't work for me.

Any ideas what I'm doing wrong here?

  • 1
    Does your implementation actually *support* 16 samples? Have you tried 8 or 4? How do you even know that there is no antialiasing? Are you looking for the right *kind* of antialiasing? – Nicol Bolas Dec 17 '17 at 17:58
  • @NicolBolas I've tried with other sample values, yes. I'm not sure what other kinds of anti-aliasing you're referring to, but no matter which value I try there's no visible change in the display – Asaf Sitner Dec 18 '17 at 09:09

0 Answers0