forked from qt-creator/qt-creator
QmlDesigner: Track time spend in design mode
Change-Id: Iabe982dcf2fc8c4ef3d10cf3d3df5b9e9b826548 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -123,6 +123,7 @@ const char EVENT_PROPERTYEDITOR_TIME[] = "propertyEditor";
|
||||
const char EVENT_ASSETSLIBRARY_TIME[] = "assetsLibrary";
|
||||
const char EVENT_ITEMLIBRARY_TIME[] = "itemLibrary";
|
||||
const char EVENT_TRANSLATIONVIEW_TIME[] = "translationView";
|
||||
const char EVENT_DESIGNMODE_TIME[] = "designMode";
|
||||
|
||||
const char PROPERTY_EDITOR_CLASSNAME_PROPERTY[] = "__classNamePrivateInternal";
|
||||
|
||||
|
@@ -482,6 +482,8 @@ void QmlDesignerPlugin::showDesigner()
|
||||
}
|
||||
|
||||
d->shortCutManager.updateUndoActions(currentDesignDocument());
|
||||
|
||||
m_usageTimer.restart();
|
||||
}
|
||||
|
||||
void QmlDesignerPlugin::hideDesigner()
|
||||
@@ -494,6 +496,7 @@ void QmlDesignerPlugin::hideDesigner()
|
||||
d->shortCutManager.disconnectUndoActions(currentDesignDocument());
|
||||
d->documentManager.setCurrentDesignDocument(nullptr);
|
||||
d->shortCutManager.updateUndoActions(nullptr);
|
||||
emitUsageStatisticsTime(QmlDesigner::Constants::EVENT_DESIGNMODE_TIME, m_usageTimer.elapsed());
|
||||
}
|
||||
|
||||
void QmlDesignerPlugin::changeEditor()
|
||||
|
@@ -35,6 +35,8 @@
|
||||
#include "shortcutmanager.h"
|
||||
#include <designeractionmanager.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QQmlEngine)
|
||||
|
||||
namespace Core {
|
||||
@@ -116,6 +118,7 @@ private: // functions
|
||||
private: // variables
|
||||
QmlDesignerPluginPrivate *d = nullptr;
|
||||
static QmlDesignerPlugin *m_instance;
|
||||
QElapsedTimer m_usageTimer;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
Reference in New Issue
Block a user