avoid deprecation warnings

This commit is contained in:
Uwe Rathmann 2020-03-12 09:56:38 +01:00
parent 32b638a2eb
commit 89b8321ed7
2 changed files with 9 additions and 1 deletions

View File

@ -10,7 +10,7 @@
QskGraphicImageProvider::QskGraphicImageProvider( QskGraphicImageProvider::QskGraphicImageProvider(
const QString& providerId, ImageType type ) const QString& providerId, ImageType type )
: QQuickImageProvider( type, 0 ) : QQuickImageProvider( type )
, m_providerId( providerId ) , m_providerId( providerId )
{ {
} }

View File

@ -32,7 +32,15 @@ QSGTexture* QskGraphicTextureFactory::createTexture( QQuickWindow* window ) cons
const auto flags = static_cast< QQuickWindow::CreateTextureOptions >( const auto flags = static_cast< QQuickWindow::CreateTextureOptions >(
QQuickWindow::TextureHasAlphaChannel | QQuickWindow::TextureOwnsGLTexture ); 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 ); return window->createTextureFromId( textureId, m_size, flags );
#endif
} }
QSize QskGraphicTextureFactory::textureSize() const QSize QskGraphicTextureFactory::textureSize() const