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)?


  • Qt Champions 2016

    hi
    Did you check where it crash ?
    You might be able to detect that init did not work and then switch to
    .setAttribute(AA_UseDesktopOpenGL)

    https://forum.qt.io/topic/51574/opengl-dynamic-selected-driver/5


  • Qt Champions 2016

    @MartinD
    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.