Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to enable OpenGl rendering in QML?
QtWS25 Last Chance

How to enable OpenGl rendering in QML?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 182 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.
  • M Offline
    M Offline
    Mizmas
    wrote last edited by
    #1

    I've tried enabling OpenGl rendering by setting the environment variable
    set QT_QUICK_BACKEND=opengl
    But I get the debug log and it falls back to using Direct3D:

    Debug: Loading backend opengl
    Warning: Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins
    

    Any help?

    jsulmJ 1 Reply Last reply
    0
    • M Mizmas

      I've tried enabling OpenGl rendering by setting the environment variable
      set QT_QUICK_BACKEND=opengl
      But I get the debug log and it falls back to using Direct3D:

      Debug: Loading backend opengl
      Warning: Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins
      

      Any help?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #2

      @Mizmas Did you do what the warning suggests?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Mizmas Did you do what the warning suggests?

        M Offline
        M Offline
        Mizmas
        wrote last edited by
        #3

        @jsulm But what subfolder is it actually looking for? It just specifies the "Plugins" folder, which I have. For example I did find the openglrenderer.dll in "C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\plugins\renderers\openglrenderer.dll"

        jsulmJ 1 Reply Last reply
        0
        • M Mizmas

          @jsulm But what subfolder is it actually looking for? It just specifies the "Plugins" folder, which I have. For example I did find the openglrenderer.dll in "C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\plugins\renderers\openglrenderer.dll"

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote last edited by
          #4

          @Mizmas Set QT_DEBUG_PLUGINS env variable before running your app to get more information why it fails (https://doc.qt.io/qt-6/debug.html)

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Mizmas Set QT_DEBUG_PLUGINS env variable before running your app to get more information why it fails (https://doc.qt.io/qt-6/debug.html)

            M Offline
            M Offline
            Mizmas
            wrote last edited by
            #5

            @jsulm Well, I think this is it, it's looking for a "scenegraph" subfolder, which isn't in my "plugins" folder, I can't find any scenegraph specifically in the Qt maintenance tool, and I do have all the additional libraries installed:
            Screenshot_1.png

            Debug: Loading backend opengl
            Debug: checking directory path "C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins/scenegraph" ...
            Debug: checking directory path "C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/bin/scenegraph" ...
            Warning: Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins
            
            jsulmJ 1 Reply Last reply
            0
            • M Mizmas

              @jsulm Well, I think this is it, it's looking for a "scenegraph" subfolder, which isn't in my "plugins" folder, I can't find any scenegraph specifically in the Qt maintenance tool, and I do have all the additional libraries installed:
              Screenshot_1.png

              Debug: Loading backend opengl
              Debug: checking directory path "C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins/scenegraph" ...
              Debug: checking directory path "C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/bin/scenegraph" ...
              Warning: Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/plugins
              
              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote last edited by
              #6

              @Mizmas I'm wondering why it is searching in C:\Qt\Tools\QtDesignStudio. It should search in the Qt installation folder. Did you change any env variable like PATH?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 2 Replies Last reply
              0
              • jsulmJ jsulm

                @Mizmas I'm wondering why it is searching in C:\Qt\Tools\QtDesignStudio. It should search in the Qt installation folder. Did you change any env variable like PATH?

                M Offline
                M Offline
                Mizmas
                wrote last edited by
                #7

                @jsulm Well, it's probably because I'm in the Qt Design Studio :D I'm just designing the UI, I'm not loading the UI with c++ or python. It should still be possible to switch the rendering though, for example I can successfully switch to software rendering, and since the Qt Design Studio has the openglrenderer.dll inside it's folder, it should also be possible.

                M 1 Reply Last reply
                0
                • M Mizmas

                  @jsulm Well, it's probably because I'm in the Qt Design Studio :D I'm just designing the UI, I'm not loading the UI with c++ or python. It should still be possible to switch the rendering though, for example I can successfully switch to software rendering, and since the Qt Design Studio has the openglrenderer.dll inside it's folder, it should also be possible.

                  M Offline
                  M Offline
                  Mizmas
                  wrote last edited by
                  #8

                  @Mizmas I did a fresh latest install of PySide6 in a .venv, and loaded the .qml file with QQmlApplicationEngine with the OpenGl environment variable set, and it's the same error, it's looking for a scenegraph subfolder inside the plugins folder, but there's no damn scenegraph folder

                  [DEBUG] checking directory path "C:/Users/gusta/OneDrive/Dokumentai/PyCharmProjects/Medieval/.venv/Lib/site-packages/PySide6/plugins/scenegraph" ...
                   [DEBUG] checking directory path "C:/Users/gusta/AppData/Local/Programs/Python/Python312/scenegraph" ...
                   [WARNING] Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in C:/Users/gusta/OneDrive/Dokumentai/PyCharmProjects/Medieval/.venv/Lib/site-packages/PySide6/plugins
                  
                  1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Mizmas I'm wondering why it is searching in C:\Qt\Tools\QtDesignStudio. It should search in the Qt installation folder. Did you change any env variable like PATH?

                    M Offline
                    M Offline
                    Mizmas
                    wrote last edited by
                    #9

                    @jsulm It turns out you need to use QSG_RHI_BACKEND=opengl instead

                    1 Reply Last reply
                    1
                    • M Mizmas has marked this topic as solved

                    • Login

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