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. QQuickFramebufferObject::Renderer::render() not even being called
Qt 6.11 is out! See what's new in the release blog

QQuickFramebufferObject::Renderer::render() not even being called

Scheduled Pinned Locked Moved Solved QML and Qt Quick
10 Posts 2 Posters 548 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kaixoo
    wrote last edited by
    #1

    Hi, I created a small Qt app that demosntrates a basic use case of QQuickFramebufferObject (OpenGL rendering).

    I am calling update() but nothing is being rendered:

    Repo: https://gitlab.com/kaixoo/app-repro-qml-ogl

    You'll need meson to run the project, you can get it like this:

    • Windows: winget install --id=mesonbuild.meson -e
    • Debian: sudo apt install meson ninja-build
    • MacOS: brew install meson
    1 Reply Last reply
    0
    • K Offline
      K Offline
      kaixoo
      wrote last edited by kaixoo
      #7

      Issue "solved" by calling update() once in the constructor and after every render, although I would prefer more manual control, that can be worked on later.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kaixoo
        wrote last edited by kaixoo
        #2

        This is a repro of an issue I'm having with my app, where the FBO only renders when getting resized, and all calls to update() are ignored. In the repro app, I'm not even getting it to render at all.

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

          Hi,

          Change Canvas by MyCanvas (or something else) in the type registration and QML.

          It worked fine after that.

          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
          2
          • K Offline
            K Offline
            kaixoo
            wrote last edited by kaixoo
            #4

            ooooohhh :((
            It also worked fine for me after that, which is weird. In my actual application, the canvas is only rendering when it's resized.
            I'm subclassing QQuickFramebufferObject::Renderer, do you think the issue could be related to that?

            P.S: Actual code is here, all contained in the src/canvas folder: https://gitlab.com/advanced-effects/Advanced-Effects/-/blob/ui/canvas-interactions/src/canvas/view/application_canvas.h?ref_type=heads

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

              No, I don't think so.
              You just choose to use the same name as an already existing QtQuick type: Canvas

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

              K 1 Reply Last reply
              1
              • SGaistS SGaist

                No, I don't think so.
                You just choose to use the same name as an already existing QtQuick type: Canvas

                K Offline
                K Offline
                kaixoo
                wrote last edited by
                #6

                @SGaist No, the name I gave it is ApplicationCanvas, and it renders correctly, so it's not that.

                Might it be related to how I'm using Skia? I'm not flushing after every frame because it was causing glitches.
                The important skia code is:

                	auto fbo = framebufferObject();
                        if (!fbo) return;
                
                        m_skia_canvas = obtain_skia_canvas(fbo);
                
                        if (!m_skia_canvas) return;
                        draw_to_screen(m_skia_canvas);
                
                SGaistS 1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kaixoo
                  wrote last edited by kaixoo
                  #7

                  Issue "solved" by calling update() once in the constructor and after every render, although I would prefer more manual control, that can be worked on later.

                  1 Reply Last reply
                  0
                  • K kaixoo has marked this topic as solved
                  • K kaixoo

                    @SGaist No, the name I gave it is ApplicationCanvas, and it renders correctly, so it's not that.

                    Might it be related to how I'm using Skia? I'm not flushing after every frame because it was causing glitches.
                    The important skia code is:

                    	auto fbo = framebufferObject();
                            if (!fbo) return;
                    
                            m_skia_canvas = obtain_skia_canvas(fbo);
                    
                            if (!m_skia_canvas) return;
                            draw_to_screen(m_skia_canvas);
                    
                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote last edited by
                    #8

                    @kaixoo said in QQuickFramebufferObject::Renderer::render() not even being called:

                    @SGaist No, the name I gave it is ApplicationCanvas, and it renders correctly, so it's not that.

                    Might it be related to how I'm using Skia? I'm not flushing after every frame because it was causing glitches.
                    The important skia code is:

                    	auto fbo = framebufferObject();
                            if (!fbo) return;
                    
                            m_skia_canvas = obtain_skia_canvas(fbo);
                    
                            if (!m_skia_canvas) return;
                            draw_to_screen(m_skia_canvas);
                    

                    Sorry, I thought you were still asking about your example !

                    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
                    • K Offline
                      K Offline
                      kaixoo
                      wrote last edited by kaixoo
                      #9

                      No problem. By chance, do you know if it's possible to receive input events from a QQuickFramebufferObject? It seems like I'm not getting those: e.g. mousePressEvent, touchEvent, etc.

                      The methods exist (as it derives from QQuickWidget) and can be overridden but it doesn't seem like they are implemented. Are they?

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

                        Where are you trying to get these events in your project ?

                        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