From 89b8321ed7719c50b0cc1accd373e765c67bfd47 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 12 Mar 2020 09:56:38 +0100 Subject: [PATCH] avoid deprecation warnings --- src/graphic/QskGraphicImageProvider.cpp | 2 +- src/graphic/QskGraphicTextureFactory.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/graphic/QskGraphicImageProvider.cpp b/src/graphic/QskGraphicImageProvider.cpp index b941d36b..4e67b6bf 100644 --- a/src/graphic/QskGraphicImageProvider.cpp +++ b/src/graphic/QskGraphicImageProvider.cpp @@ -10,7 +10,7 @@ QskGraphicImageProvider::QskGraphicImageProvider( const QString& providerId, ImageType type ) - : QQuickImageProvider( type, 0 ) + : QQuickImageProvider( type ) , m_providerId( providerId ) { } diff --git a/src/graphic/QskGraphicTextureFactory.cpp b/src/graphic/QskGraphicTextureFactory.cpp index 0a2543e3..b9e04f6d 100644 --- a/src/graphic/QskGraphicTextureFactory.cpp +++ b/src/graphic/QskGraphicTextureFactory.cpp @@ -32,7 +32,15 @@ QSGTexture* QskGraphicTextureFactory::createTexture( QQuickWindow* window ) cons const auto flags = static_cast< QQuickWindow::CreateTextureOptions >( QQuickWindow::TextureHasAlphaChannel | QQuickWindow::TextureOwnsGLTexture ); +#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 ) + const int nativeLayout = 0; // VkImageLayout in case of Vulkan + + return window->createTextureFromNativeObject( + QQuickWindow::NativeObjectTexture, &textureId, nativeLayout, + m_size, flags ); +#else return window->createTextureFromId( textureId, m_size, flags ); +#endif } QSize QskGraphicTextureFactory::textureSize() const