Commit 95505eb0 authored by Volker Krause's avatar Volker Krause
Browse files

Adapt to OpenGL related Qt6 QQuickWindow API changes

parent 4009345e
Pipeline #155709 passed with stage
in 26 minutes and 3 seconds
......@@ -27,6 +27,8 @@
#include <QOpenGLFramebufferObject>
#include <QTimer>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QQuickOpenGLUtils>
#include <QQuickRenderTarget>
#include <private/qeventpoint_p.h> // for QMutableEventPoint
#endif
......@@ -267,7 +269,11 @@ void OffscreenQuickView::update()
return;
}
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
d->m_view->setRenderTarget(d->m_fbo.data());
#else
d->m_view->setRenderTarget(QQuickRenderTarget::fromOpenGLTexture(d->m_fbo->texture(), d->m_fbo->size()));
#endif
}
d->m_renderControl->polishItems();
......@@ -275,7 +281,11 @@ void OffscreenQuickView::update()
d->m_renderControl->render();
if (usingGl) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
d->m_view->resetOpenGLState();
#else
QQuickOpenGLUtils::resetOpenGLState();
#endif
}
if (d->m_useBlit) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment