forked from qt-creator/qt-creator
QmlDesigner: Collect usage statistics for contex help
Change-Id: Ie1a1250abc6e55c13d71d8545a50d539f4360392 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -633,7 +633,15 @@ void AbstractView::enableWidget()
|
|||||||
void AbstractView::contextHelp(const Core::IContext::HelpCallback &callback) const
|
void AbstractView::contextHelp(const Core::IContext::HelpCallback &callback) const
|
||||||
{
|
{
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
|
||||||
|
const QString id = const_cast<AbstractView *>(this)->widgetInfo().uniqueId;
|
||||||
|
|
||||||
|
QString nodeId;
|
||||||
|
if (!selectedModelNodes().isEmpty())
|
||||||
|
nodeId = selectedModelNodes().first().simplifiedTypeName();
|
||||||
|
QmlDesignerPlugin::instance()->emitUsageStatisticsHelpRequested(id + " " + nodeId);
|
||||||
QmlDesignerPlugin::instance()->viewManager().qmlJSEditorContextHelp(callback);
|
QmlDesignerPlugin::instance()->viewManager().qmlJSEditorContextHelp(callback);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
callback(QString());
|
callback(QString());
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ const char EVENT_PROPERTY_ADDED[] = "Property Added";
|
|||||||
const char EVENT_ANNOTATION_ADDED[] = "Annotation Added";
|
const char EVENT_ANNOTATION_ADDED[] = "Annotation Added";
|
||||||
const char EVENT_RESOURCE_IMPORTED[] = "Resource Imported ";
|
const char EVENT_RESOURCE_IMPORTED[] = "Resource Imported ";
|
||||||
const char EVENT_ACTION_EXECUTED[] = "Action Executed ";
|
const char EVENT_ACTION_EXECUTED[] = "Action Executed ";
|
||||||
|
const char EVENT_HELP_REQUESTED[] = "Help Requested ";
|
||||||
const char EVENT_IMPORT_ADDED[] = "Import Added ";
|
const char EVENT_IMPORT_ADDED[] = "Import Added ";
|
||||||
const char EVENT_BINDINGEDITOR_OPENED[] = "Binding Editor Opened";
|
const char EVENT_BINDINGEDITOR_OPENED[] = "Binding Editor Opened";
|
||||||
const char EVENT_RICHTEXT_OPENED[] = "Richtext Editor Opened";
|
const char EVENT_RICHTEXT_OPENED[] = "Richtext Editor Opened";
|
||||||
|
|||||||
@@ -617,6 +617,11 @@ void QmlDesignerPlugin::emitUsageStatisticsContextAction(const QString &identifi
|
|||||||
emitUsageStatistics(Constants::EVENT_ACTION_EXECUTED + identifier);
|
emitUsageStatistics(Constants::EVENT_ACTION_EXECUTED + identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlDesignerPlugin::emitUsageStatisticsHelpRequested(const QString &identifier)
|
||||||
|
{
|
||||||
|
emitUsageStatistics(Constants::EVENT_HELP_REQUESTED + identifier);
|
||||||
|
}
|
||||||
|
|
||||||
AsynchronousImageCache &QmlDesignerPlugin::imageCache()
|
AsynchronousImageCache &QmlDesignerPlugin::imageCache()
|
||||||
{
|
{
|
||||||
return m_instance->d->viewManager.imageCache();
|
return m_instance->d->viewManager.imageCache();
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public:
|
|||||||
|
|
||||||
static void emitUsageStatistics(const QString &identifier);
|
static void emitUsageStatistics(const QString &identifier);
|
||||||
static void emitUsageStatisticsContextAction(const QString &identifier);
|
static void emitUsageStatisticsContextAction(const QString &identifier);
|
||||||
|
static void emitUsageStatisticsHelpRequested(const QString &identifier);
|
||||||
static void emitUsageStatisticsTime(const QString &identifier, int elapsed);
|
static void emitUsageStatisticsTime(const QString &identifier, int elapsed);
|
||||||
|
|
||||||
static AsynchronousImageCache &imageCache();
|
static AsynchronousImageCache &imageCache();
|
||||||
|
|||||||
Reference in New Issue
Block a user