Qt app crashes on Win 7 unless AA_UseDesktopOpenGL is set explicitly

  • I have a computer with Windows 7 where my QtQuick 2 Qt 5.7.0 app crashes. I have to explicitly set app.setAttribute(AA_UseDesktopOpenGL), then my application on this particular computer works.

    Is there a way to automatically handle this situation? I don't know how safe it is to hard set app.setAttribute(AA_UseDesktopOpenGL). I would rather detect whether the app will run on the PC and if not then set app.setAttribute(AA_UseDesktopOpenGL). Is there a way to accomplish this automatically without user seeing anything (mainly app crash popup)?

  • Lifetime Qt Champion

    Did you check where it crash ?
    You might be able to detect that init did not work and then switch to


  • Qt Champions 2017

    Also as Chris mentioned here this attribute should be set before you have the application object. As a rule of thumb, don't call static functions like methods, it only creates confusion.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.