QQuickFramebufferObject::Renderer::render() not even being called
-
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
mesonto 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
- Windows:
-
Hi,
Change Canvas by MyCanvas (or something else) in the type registration and QML.
It worked fine after that.
-
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 subclassingQQuickFramebufferObject::Renderer, do you think the issue could be related to that?P.S: Actual code is here, all contained in the
src/canvasfolder: https://gitlab.com/advanced-effects/Advanced-Effects/-/blob/ui/canvas-interactions/src/canvas/view/application_canvas.h?ref_type=heads -
No, I don't think so.
You just choose to use the same name as an already existing QtQuick type: Canvas@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); -
K kaixoo has marked this topic as solved
-
@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);@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 !
-
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? -
Where are you trying to get these events in your project ?