diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp index 6ef3c6d5d61..78014142e3b 100644 --- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp +++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp @@ -633,7 +633,15 @@ void AbstractView::enableWidget() void AbstractView::contextHelp(const Core::IContext::HelpCallback &callback) const { #ifndef QMLDESIGNER_TEST + + const QString id = const_cast(this)->widgetInfo().uniqueId; + + QString nodeId; + if (!selectedModelNodes().isEmpty()) + nodeId = selectedModelNodes().first().simplifiedTypeName(); + QmlDesignerPlugin::instance()->emitUsageStatisticsHelpRequested(id + " " + nodeId); QmlDesignerPlugin::instance()->viewManager().qmlJSEditorContextHelp(callback); + #else callback(QString()); #endif diff --git a/src/plugins/qmldesigner/qmldesignerconstants.h b/src/plugins/qmldesigner/qmldesignerconstants.h index 3830c9e8da8..1bfdbb8ddbf 100644 --- a/src/plugins/qmldesigner/qmldesignerconstants.h +++ b/src/plugins/qmldesigner/qmldesignerconstants.h @@ -97,6 +97,7 @@ const char EVENT_PROPERTY_ADDED[] = "Property Added"; const char EVENT_ANNOTATION_ADDED[] = "Annotation Added"; const char EVENT_RESOURCE_IMPORTED[] = "Resource Imported "; const char EVENT_ACTION_EXECUTED[] = "Action Executed "; +const char EVENT_HELP_REQUESTED[] = "Help Requested "; const char EVENT_IMPORT_ADDED[] = "Import Added "; const char EVENT_BINDINGEDITOR_OPENED[] = "Binding Editor Opened"; const char EVENT_RICHTEXT_OPENED[] = "Richtext Editor Opened"; diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index ec4957bcc9d..2114a56d3d7 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -617,6 +617,11 @@ void QmlDesignerPlugin::emitUsageStatisticsContextAction(const QString &identifi emitUsageStatistics(Constants::EVENT_ACTION_EXECUTED + identifier); } +void QmlDesignerPlugin::emitUsageStatisticsHelpRequested(const QString &identifier) +{ + emitUsageStatistics(Constants::EVENT_HELP_REQUESTED + identifier); +} + AsynchronousImageCache &QmlDesignerPlugin::imageCache() { return m_instance->d->viewManager.imageCache(); diff --git a/src/plugins/qmldesigner/qmldesignerplugin.h b/src/plugins/qmldesigner/qmldesignerplugin.h index a773368c4d8..22800aa0454 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.h +++ b/src/plugins/qmldesigner/qmldesignerplugin.h @@ -87,6 +87,7 @@ public: static void emitUsageStatistics(const QString &identifier); static void emitUsageStatisticsContextAction(const QString &identifier); + static void emitUsageStatisticsHelpRequested(const QString &identifier); static void emitUsageStatisticsTime(const QString &identifier, int elapsed); static AsynchronousImageCache &imageCache();