Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML application fails to start when QT_OPENGL=desktop set

QML application fails to start when QT_OPENGL=desktop set

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 705 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bob64
    wrote on last edited by
    #1

    A QML app which had been working fine on Windows starting failing to start for a user. The window was popping up blank briefly before closing. This is typical of some sort of OpenGL support issue in my experience so I asked him to try with QT_QUICK_BACKEND=software and sure enough that worked.

    After I asked whether anything might have changed that could have affected graphics, it transpired that he had been told to set QT_OPENGL=desktop to allow a different Qt-based application (a Qt Widgets app that incorporates an OpenGL-based graphics viewer) to run. If he unset this variable, the QML application runs without the QT_QUICK_BACKEND setting.

    I'm not familiar with this QT_OPENGL setting so I don't know what the implications are. Does anyone have any idea what might be going on, why it might be needed for a Qt Widgets app but prevents a QML app from running etc?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If memory serves well, the Windows backend switches dynamically at start up between different implementation based on what it detects on the machine. Forcing it to OpenGL means that it disables the possibility to load the ANGLE backend which seems to be what your application is using.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        If memory serves well, the Windows backend switches dynamically at start up between different implementation based on what it detects on the machine. Forcing it to OpenGL means that it disables the possibility to load the ANGLE backend which seems to be what your application is using.

        B Offline
        B Offline
        Bob64
        wrote on last edited by Bob64
        #3

        @SGaist Thank you. This concurs with what I have since found out.

        I got him to run the QML GUI with QSG_INFO=1, both with the QT_OPENGL setting and without.

        When QT_OPENGL is not set, it is using ANGLE:

        Debug: GL_VENDOR:          Google Inc.
        Debug: GL_RENDERER:        ANGLE (Microsoft Basic Render Driver Direct3D11 vs_5_0 ps_5_0)
        Debug: GL_VERSION:         OpenGL ES 2.0 (ANGLE 2.1.0.8613f4946861)
        

        When QT_OPENGL is set, it just tries to use basic generic GL which is not sufficient for QML:

        Debug: GL_VENDOR:          Microsoft Corporation
        Debug: GL_RENDERER:        GDI Generic
        Debug: GL_VERSION:         1.1.0
        

        I am tempted to fix my application's startup script to filter out any setting of QT_OPENGL. I don't know if that could cause other problems down the line though...

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The idea behind the dynamic backend is to be able to detect what is available. From the looks of it there's an issue with the driver on that machine.

          In any case, forcing the backend to desktop for all Qt applications on a system is wrong. It should be done on an application basis.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved