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

@@ -46,7 +46,9 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
setObjectName("QmlProfiler.FlameGraph.Dock");
setWindowTitle(tr("Flame Graph"));
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
qmlRegisterType<FlameGraph::FlameGraph>("QtCreator.Tracing", 1, 0, "FlameGraph");
#endif // Qt < 6.2
qmlRegisterUncreatableType<FlameGraphModel>("QtCreator.QmlProfiler", 1, 0,
"QmlProfilerFlameGraphModel",
QLatin1String("use the context property"));