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);