From 79d08bd5dd2f985cb8fd2e66774830d1e339e287 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 2 Jun 2022 12:46:20 +0200 Subject: [PATCH] Tracing/QmlProfiler: Fix deprecation warning with Qt 6.3+ From Qt 6.3 on, QSGMaterial::CustomCompileStep is deprecated and QSGMaterial::NoBatching should be used, instead. Change-Id: I27b2fd2e8b86de85ec88ab81b90e056005a4986d Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Laszlo Agocs --- src/libs/tracing/timelineitemsrenderpass.cpp | 6 ++++-- src/libs/tracing/timelinenotesrenderpass.cpp | 6 ++++-- .../qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/libs/tracing/timelineitemsrenderpass.cpp b/src/libs/tracing/timelineitemsrenderpass.cpp index 8b0698c54c3..efdf23e0800 100644 --- a/src/libs/tracing/timelineitemsrenderpass.cpp +++ b/src/libs/tracing/timelineitemsrenderpass.cpp @@ -542,9 +542,11 @@ void TimelineItemsMaterialShader::initialize() TimelineItemsMaterial::TimelineItemsMaterial() : m_selectedItem(-1) { setFlag(QSGMaterial::Blending, false); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) + setFlag(QSGMaterial::NoBatching, true); +#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) setFlag(QSGMaterial::CustomCompileStep, true); -#endif // >= Qt 6 +#endif // >= Qt 6.3/6.0 } QVector2D TimelineItemsMaterial::scale() const diff --git a/src/libs/tracing/timelinenotesrenderpass.cpp b/src/libs/tracing/timelinenotesrenderpass.cpp index 7eaefe9875d..bdedb595fc4 100644 --- a/src/libs/tracing/timelinenotesrenderpass.cpp +++ b/src/libs/tracing/timelinenotesrenderpass.cpp @@ -178,9 +178,11 @@ TimelineNotesRenderPassState::TimelineNotesRenderPassState(int numExpandedRows) m_nullGeometry(NotesGeometry::point2DWithDistanceFromTop(), 0) { m_material.setFlag(QSGMaterial::Blending, true); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) + m_material.setFlag(QSGMaterial::NoBatching, true); +#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_material.setFlag(QSGMaterial::CustomCompileStep, true); -#endif // >= Qt 6 +#endif // >= Qt 6.3/6.0 m_expandedRows.reserve(numExpandedRows); for (int i = 0; i < numExpandedRows; ++i) m_expandedRows << createNode(); diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index edcc9d6361e..b713acbf47e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -383,9 +383,11 @@ void BindingLoopMaterialShader::initialize() BindingLoopMaterial::BindingLoopMaterial() { setFlag(QSGMaterial::Blending, false); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) + setFlag(QSGMaterial::NoBatching, true); +#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) setFlag(QSGMaterial::CustomCompileStep, true); -#endif // >= Qt 6 +#endif // >= Qt 6.3/6.0 } QSGMaterialType *BindingLoopMaterial::type() const