Adapt to QQuickWindow::createTextureFromNativeObject being gone in Qt6
This commit is contained in:
parent
f31b4b36d7
commit
b99c5f9a63
1 changed files with 6 additions and 0 deletions
|
@ -57,10 +57,16 @@ void ThumbnailTextureProvider::setTexture(const QSharedPointer<GLTexture> &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);
|
||||
|
|
Loading…
Reference in a new issue