Tracing: Add qml, register types via qt_add_qml_module

Use the CMake-based qml API to create the "QtCreator.Tracing" module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: I4d63f9f724d0628cfaab9d1164c0d575f15d15aa
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Alessandro Portale
2021-06-09 16:56:48 +02:00
parent 693d54a069
commit a56ce4e450
25 changed files with 200 additions and 74 deletions

View File

@@ -247,11 +247,11 @@ NotesMaterialShader::NotesMaterialShader()
: QSGMaterialShader()
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/tracing/notes.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/tracing/notes.frag"));
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/QtCreator/Tracing/notes.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/QtCreator/Tracing/notes.frag"));
#else // < Qt 6
setShaderFileName(VertexStage, ":/tracing/notes.vert");
setShaderFileName(FragmentStage, ":/tracing/notes.frag");
setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes.vert");
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes.frag");
#endif // < Qt 6
}