From b99c5f9a636fdb6131a6fe494963d73cd26b3119 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sat, 12 Mar 2022 12:46:22 +0100 Subject: [PATCH] Adapt to QQuickWindow::createTextureFromNativeObject being gone in Qt6 --- src/scripting/thumbnailitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripting/thumbnailitem.cpp b/src/scripting/thumbnailitem.cpp index 38410ac539..36bd248681 100644 --- a/src/scripting/thumbnailitem.cpp +++ b/src/scripting/thumbnailitem.cpp @@ -57,10 +57,16 @@ void ThumbnailTextureProvider::setTexture(const QSharedPointer &nativ if (m_nativeTexture != nativeTexture) { const GLuint textureId = nativeTexture->texture(); m_nativeTexture = nativeTexture; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) m_texture.reset(m_window->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, &textureId, 0, nativeTexture->size(), QQuickWindow::TextureHasAlphaChannel)); +#else + m_texture.reset(QNativeInterface::QSGOpenGLTexture::fromNative(textureId, m_window, + nativeTexture->size(), + QQuickWindow::TextureHasAlphaChannel)); +#endif m_texture->setFiltering(QSGTexture::Linear); m_texture->setHorizontalWrapMode(QSGTexture::ClampToEdge); m_texture->setVerticalWrapMode(QSGTexture::ClampToEdge);