[Interest] Attribute Qt::AA_UseOpenGLES must be set before QCoreApplication is created.

Thomas Sevaldrud thomas at silentwings.no
Fri Oct 18 11:28:58 CEST 2019


Hi,

I have a Windows WPF/C# application that uses ANGLE/OpenGL through Qt. This
works nicely and has done so for many years. However, some time around 5.12
I started getting this warning when setting up my OpenGL context:

   Attribute Qt::AA_UseOpenGLES must be set before QCoreApplication is
created.

I doesn't actually appear to have any negative consequences. Everything
works as before, but our users are complaining about the warning :)

The reason that these attributes are set after creating the QApplication is
that I have a fallback system where I can try for software rendering if the
ANGLE setup fails for some reason (crappy drivers, etc). So if my GLContext
with AA_UseOpenGLES fails, I try again with AA_UseSoftwareOpenGL. This also
appears to work nicely.

I don't actually use the QApplication for anything, I'm only using Qt as a
GL wrapper with no QML, Gui, Network or anything. So I tried to simply
remove the QGuiApplication, but then it crashes during
QOpenGLContext::create(), so I guess it needs to exist after all.

So my question is basically why this warning was introduced? Are there any
consequences here that I just haven't noticed yet? Is there a way to
disable this warning through QLoggingCategory::setFilterRules or something?

Cheers,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20191018/20b87c72/attachment.html>


More information about the Interest mailing list