QmlProfiler: Make notes a property of timeline model aggregator

Change-Id: I5aa8162d18fad46601198fe71fe87591737c30ff
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-11-04 14:41:32 +01:00
committed by Ulf Hermann
parent 85768a4864
commit e570e7a271
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,7 @@
#include "qmlprofilerstatemanager.h" #include "qmlprofilerstatemanager.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "timelinemodelaggregator.h" #include "timelinemodelaggregator.h"
#include "qmlprofilernotesmodel.h"
// Needed for the load&save actions in the context menu // Needed for the load&save actions in the context menu
#include <analyzerbase/ianalyzertool.h> #include <analyzerbase/ianalyzertool.h>
@@ -100,6 +101,8 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
groupLayout->setContentsMargins(0, 0, 0, 0); groupLayout->setContentsMargins(0, 0, 0, 0);
groupLayout->setSpacing(0); groupLayout->setSpacing(0);
qmlRegisterType<QmlProfilerNotesModel>();
d->m_mainView = new QmlProfilerQuickView(this); d->m_mainView = new QmlProfilerQuickView(this);
d->m_mainView->setResizeMode(QQuickView::SizeRootObjectToView); d->m_mainView->setResizeMode(QQuickView::SizeRootObjectToView);
QWidget *mainViewContainer = QWidget::createWindowContainer(d->m_mainView); QWidget *mainViewContainer = QWidget::createWindowContainer(d->m_mainView);

View File

@@ -42,6 +42,7 @@ class TimelineModelAggregator : public QObject
Q_OBJECT Q_OBJECT
Q_PROPERTY(int height READ height NOTIFY heightChanged) Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(QVariantList models READ models NOTIFY modelsChanged) Q_PROPERTY(QVariantList models READ models NOTIFY modelsChanged)
Q_PROPERTY(QmlProfiler::QmlProfilerNotesModel *notes READ notes CONSTANT)
public: public:
TimelineModelAggregator(QObject *parent = 0); TimelineModelAggregator(QObject *parent = 0);
~TimelineModelAggregator(); ~TimelineModelAggregator();
@@ -53,7 +54,7 @@ public:
QVariantList models() const; QVariantList models() const;
int modelIndexFromManagerIndex(int modelManagerIndex) const; int modelIndexFromManagerIndex(int modelManagerIndex) const;
Q_INVOKABLE QmlProfilerNotesModel *notes() const; QmlProfilerNotesModel *notes() const;
Q_INVOKABLE int count(int modelIndex) const; Q_INVOKABLE int count(int modelIndex) const;
void clear(); void clear();
Q_INVOKABLE int modelCount() const; Q_INVOKABLE int modelCount() const;