forked from qt-creator/qt-creator
QmlDesigner: Collect usage time for more views
This collects the time for: property editor states editor item library asset library text editor Change-Id: I07cb5a75f1e007555f0d03d2518246a27e60f305 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -110,6 +110,19 @@ bool AssetsLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
return QObject::eventFilter(obj, event);
|
return QObject::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AssetsLibraryWidget::focusOutEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
QmlDesignerPlugin::emitUsageStatisticsTime(Constants::EVENT_ASSETSLIBRARY_TIME,
|
||||||
|
m_usageTimer.elapsed());
|
||||||
|
QFrame::focusOutEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsLibraryWidget::focusInEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
m_usageTimer.restart();
|
||||||
|
QFrame::focusInEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
AssetsLibraryWidget::AssetsLibraryWidget(AsynchronousImageCache &asynchronousFontImageCache,
|
AssetsLibraryWidget::AssetsLibraryWidget(AsynchronousImageCache &asynchronousFontImageCache,
|
||||||
SynchronousImageCache &synchronousFontImageCache)
|
SynchronousImageCache &synchronousFontImageCache)
|
||||||
: m_itemIconSize(24, 24)
|
: m_itemIconSize(24, 24)
|
||||||
|
@@ -28,13 +28,14 @@
|
|||||||
#include <previewtooltip/previewtooltipbackend.h>
|
#include <previewtooltip/previewtooltipbackend.h>
|
||||||
#include "assetslibrarymodel.h"
|
#include "assetslibrarymodel.h"
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QElapsedTimer>
|
||||||
#include <QToolButton>
|
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
#include <QQuickWidget>
|
#include <QFrame>
|
||||||
#include <QQmlPropertyMap>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
#include <QQmlPropertyMap>
|
||||||
|
#include <QQuickWidget>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -89,6 +90,8 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
void focusOutEvent(QFocusEvent *focusEvent) override;
|
||||||
|
void focusInEvent(QFocusEvent *focusEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadQmlSource();
|
void reloadQmlSource();
|
||||||
@@ -114,6 +117,7 @@ private:
|
|||||||
bool m_updateRetry = false;
|
bool m_updateRetry = false;
|
||||||
QString m_filterText;
|
QString m_filterText;
|
||||||
QPoint m_dragStartPoint;
|
QPoint m_dragStartPoint;
|
||||||
|
QElapsedTimer m_usageTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -30,14 +30,14 @@
|
|||||||
|
|
||||||
#include <theme.h>
|
#include <theme.h>
|
||||||
|
|
||||||
|
#include "modelnodeoperations.h"
|
||||||
#include <designeractionmanager.h>
|
#include <designeractionmanager.h>
|
||||||
#include <designermcumanager.h>
|
#include <designermcumanager.h>
|
||||||
#include <documentmanager.h>
|
#include <documentmanager.h>
|
||||||
|
#include <itemlibraryaddimportmodel.h>
|
||||||
#include <itemlibraryimageprovider.h>
|
#include <itemlibraryimageprovider.h>
|
||||||
#include <itemlibraryinfo.h>
|
#include <itemlibraryinfo.h>
|
||||||
#include <itemlibrarymodel.h>
|
#include <itemlibrarymodel.h>
|
||||||
#include <itemlibraryaddimportmodel.h>
|
|
||||||
#include "modelnodeoperations.h"
|
|
||||||
#include <metainfo.h>
|
#include <metainfo.h>
|
||||||
#include <model.h>
|
#include <model.h>
|
||||||
#include <rewritingexception.h>
|
#include <rewritingexception.h>
|
||||||
@@ -140,6 +140,19 @@ void ItemLibraryWidget::resizeEvent(QResizeEvent *event)
|
|||||||
isHorizontalLayout = event->size().width() >= HORIZONTAL_LAYOUT_WIDTH_LIMIT;
|
isHorizontalLayout = event->size().width() >= HORIZONTAL_LAYOUT_WIDTH_LIMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ItemLibraryWidget::focusOutEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
QmlDesignerPlugin::emitUsageStatisticsTime(Constants::EVENT_ITEMLIBRARY_TIME,
|
||||||
|
m_usageTimer.elapsed());
|
||||||
|
QFrame::focusOutEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ItemLibraryWidget::focusInEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
m_usageTimer.restart();
|
||||||
|
QFrame::focusInEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
|
ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
|
||||||
AsynchronousImageCache &asynchronousFontImageCache,
|
AsynchronousImageCache &asynchronousFontImageCache,
|
||||||
SynchronousImageCache &synchronousFontImageCache)
|
SynchronousImageCache &synchronousFontImageCache)
|
||||||
|
@@ -32,13 +32,14 @@
|
|||||||
#include <utils/dropsupport.h>
|
#include <utils/dropsupport.h>
|
||||||
#include <previewtooltip/previewtooltipbackend.h>
|
#include <previewtooltip/previewtooltipbackend.h>
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QElapsedTimer>
|
||||||
#include <QToolButton>
|
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
#include <QQuickWidget>
|
#include <QFrame>
|
||||||
#include <QQmlPropertyMap>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
#include <QQmlPropertyMap>
|
||||||
|
#include <QQuickWidget>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -104,6 +105,8 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
void focusOutEvent(QFocusEvent *focusEvent) override;
|
||||||
|
void focusInEvent(QFocusEvent *focusEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadQmlSource();
|
void reloadQmlSource();
|
||||||
@@ -132,6 +135,7 @@ private:
|
|||||||
QString m_filterText;
|
QString m_filterText;
|
||||||
QPoint m_dragStartPoint;
|
QPoint m_dragStartPoint;
|
||||||
bool m_subCompEditMode = false;
|
bool m_subCompEditMode = false;
|
||||||
|
QElapsedTimer m_usageTimer;
|
||||||
|
|
||||||
inline static int HORIZONTAL_LAYOUT_WIDTH_LIMIT = 600;
|
inline static int HORIZONTAL_LAYOUT_WIDTH_LIMIT = 600;
|
||||||
};
|
};
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include "propertyeditorwidget.h"
|
#include "propertyeditorwidget.h"
|
||||||
|
|
||||||
|
#include <qmldesignerconstants.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
@@ -32,6 +34,19 @@ PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) : QStackedWidget(par
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropertyEditorWidget::focusOutEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
QmlDesignerPlugin::emitUsageStatisticsTime(Constants::EVENT_PROPERTYEDITOR_TIME,
|
||||||
|
m_usageTimer.elapsed());
|
||||||
|
QStackedWidget::focusOutEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PropertyEditorWidget::focusInEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
m_usageTimer.restart();
|
||||||
|
QStackedWidget::focusInEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
void PropertyEditorWidget::resizeEvent(QResizeEvent * event)
|
void PropertyEditorWidget::resizeEvent(QResizeEvent * event)
|
||||||
{
|
{
|
||||||
QStackedWidget::resizeEvent(event);
|
QStackedWidget::resizeEvent(event);
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -41,7 +42,12 @@ signals:
|
|||||||
void resized();
|
void resized();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void focusOutEvent(QFocusEvent *focusEvent) override;
|
||||||
|
void focusInEvent(QFocusEvent *focusEvent) override;
|
||||||
void resizeEvent(QResizeEvent * event) override;
|
void resizeEvent(QResizeEvent * event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QElapsedTimer m_usageTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //QmlDesigner
|
} //QmlDesigner
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include <designersettings.h>
|
#include <designersettings.h>
|
||||||
#include <theme.h>
|
#include <theme.h>
|
||||||
|
#include <qmldesignerconstants.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
#include <invalidqmlsourceexception.h>
|
#include <invalidqmlsourceexception.h>
|
||||||
|
|
||||||
@@ -139,6 +141,19 @@ void StatesEditorWidget::showEvent(QShowEvent *event)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StatesEditorWidget::focusOutEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
QmlDesignerPlugin::emitUsageStatisticsTime(Constants::EVENT_STATESEDITOR_TIME,
|
||||||
|
m_usageTimer.elapsed());
|
||||||
|
QQuickWidget::focusOutEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatesEditorWidget::focusInEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
m_usageTimer.restart();
|
||||||
|
QQuickWidget::focusInEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
void StatesEditorWidget::reloadQmlSource()
|
void StatesEditorWidget::reloadQmlSource()
|
||||||
{
|
{
|
||||||
QString statesListQmlFilePath = qmlSourcesPath() + QStringLiteral("/StatesList.qml");
|
QString statesListQmlFilePath = qmlSourcesPath() + QStringLiteral("/StatesList.qml");
|
||||||
|
@@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QQuickWidget>
|
#include <QElapsedTimer>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QQmlPropertyMap>
|
#include <QQmlPropertyMap>
|
||||||
|
#include <QQuickWidget>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QShortcut;
|
class QShortcut;
|
||||||
@@ -59,6 +60,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *) override;
|
void showEvent(QShowEvent *) override;
|
||||||
|
void focusOutEvent(QFocusEvent *focusEvent) override;
|
||||||
|
void focusInEvent(QFocusEvent *focusEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadQmlSource();
|
void reloadQmlSource();
|
||||||
@@ -67,6 +70,7 @@ private:
|
|||||||
QPointer<StatesEditorView> m_statesEditorView;
|
QPointer<StatesEditorView> m_statesEditorView;
|
||||||
Internal::StatesEditorImageProvider *m_imageProvider;
|
Internal::StatesEditorImageProvider *m_imageProvider;
|
||||||
QShortcut *m_qmlSourceUpdateShortcut;
|
QShortcut *m_qmlSourceUpdateShortcut;
|
||||||
|
QElapsedTimer m_usageTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
#include <rewriterview.h>
|
#include <rewriterview.h>
|
||||||
|
|
||||||
|
#include <qmldesignerconstants.h>
|
||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
#include <theme.h>
|
#include <theme.h>
|
||||||
@@ -240,4 +241,17 @@ void TextEditorWidget::dropEvent(QDropEvent *dropEvent)
|
|||||||
actionManager.handleExternalAssetsDrop(dropEvent->mimeData());
|
actionManager.handleExternalAssetsDrop(dropEvent->mimeData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextEditorWidget::focusOutEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
QmlDesignerPlugin::emitUsageStatisticsTime(Constants::EVENT_TEXTEDITOR_TIME,
|
||||||
|
m_usageTimer.elapsed());
|
||||||
|
QWidget::focusOutEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextEditorWidget::focusInEvent(QFocusEvent *focusEvent)
|
||||||
|
{
|
||||||
|
m_usageTimer.restart();
|
||||||
|
QWidget::focusInEvent(focusEvent);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
|
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@@ -69,6 +70,8 @@ protected:
|
|||||||
bool eventFilter(QObject *object, QEvent *event) override;
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
void dragEnterEvent(QDragEnterEvent *dragEnterEvent) override;
|
void dragEnterEvent(QDragEnterEvent *dragEnterEvent) override;
|
||||||
void dropEvent(QDropEvent *dropEvent) override;
|
void dropEvent(QDropEvent *dropEvent) override;
|
||||||
|
void focusOutEvent(QFocusEvent *focusEvent) override;
|
||||||
|
void focusInEvent(QFocusEvent *focusEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateSelectionByCursorPosition();
|
void updateSelectionByCursorPosition();
|
||||||
@@ -81,6 +84,7 @@ private:
|
|||||||
QVBoxLayout *m_layout = nullptr;
|
QVBoxLayout *m_layout = nullptr;
|
||||||
bool m_blockCursorSelectionSynchronisation = false;
|
bool m_blockCursorSelectionSynchronisation = false;
|
||||||
bool m_blockRoundTrip = false;
|
bool m_blockRoundTrip = false;
|
||||||
|
QElapsedTimer m_usageTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -117,6 +117,12 @@ const char EVENT_3DEDITOR_TIME[] = "3DEditor";
|
|||||||
const char EVENT_TIMELINE_TIME[] = "timeline";
|
const char EVENT_TIMELINE_TIME[] = "timeline";
|
||||||
const char EVENT_TRANSITIONEDITOR_TIME[] = "transitionEditor";
|
const char EVENT_TRANSITIONEDITOR_TIME[] = "transitionEditor";
|
||||||
const char EVENT_CURVEDITOR_TIME[] = "curveEditor";
|
const char EVENT_CURVEDITOR_TIME[] = "curveEditor";
|
||||||
|
const char EVENT_STATESEDITOR_TIME[] = "statesEditor";
|
||||||
|
const char EVENT_TEXTEDITOR_TIME[] = "textEditor";
|
||||||
|
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 PROPERTY_EDITOR_CLASSNAME_PROPERTY[] = "__classNamePrivateInternal";
|
const char PROPERTY_EDITOR_CLASSNAME_PROPERTY[] = "__classNamePrivateInternal";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user