aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/flamegraphmodel.h
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2021-06-24 23:15:42 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2021-06-28 15:06:45 +0000
commit9624d2cd6924d9053140e1c60e0137b3bb76c414 (patch)
treeb8ba6fc24ce7bcff8ecce88840bcb8376f8d130f /src/plugins/qmlprofiler/flamegraphmodel.h
parent3ebe5dbb99f788e1c93e8484431c796b29f2e256 (diff)
QmlProfiler: Add qml, register types via qt_add_qml_module
Use the CMake-based qml API to create the "QtCreator.QmlProfiler" 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: If381059bbf2a0a2b92c7f62e6da3142036ac6bbc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/flamegraphmodel.h')
-rw-r--r--src/plugins/qmlprofiler/flamegraphmodel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/flamegraphmodel.h b/src/plugins/qmlprofiler/flamegraphmodel.h
index 456502b9322..3e536bf2200 100644
--- a/src/plugins/qmlprofiler/flamegraphmodel.h
+++ b/src/plugins/qmlprofiler/flamegraphmodel.h
@@ -55,6 +55,10 @@ struct FlameGraphData {
class FlameGraphModel : public QAbstractItemModel
{
Q_OBJECT
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ QML_NAMED_ELEMENT(QmlProfilerFlameGraphModel)
+ QML_UNCREATABLE("use the context property")
+#endif // Qt >= 6.2
public:
enum Role {
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string