QmlProfiler: Use timeline theme also for flame graph

Flame graph and timeline are similar in visual appearance, so they can
share theme settings.

Change-Id: I2e078fd8aa55d3b21e31abc82b967093623a2ab3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Ulf Hermann
2016-08-04 11:11:54 +02:00
parent 8448f412ec
commit 2cc261a184
2 changed files with 16 additions and 3 deletions

View File

@@ -28,6 +28,8 @@
#include "qmlprofilertool.h"
#include <flamegraph/flamegraph.h>
#include <timeline/timelinetheme.h>
#include <utils/theme/theme.h>
#include <QQmlEngine>
#include <QQmlContext>
@@ -53,9 +55,11 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
qmlRegisterUncreatableType<QAbstractItemModel>("AbstractItemModel", 1, 0, "AbstractItemModel",
QLatin1String("only for Qt 5.4"));
Timeline::TimelineTheme::setupTheme(m_content->engine());
m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
m_content->setSource(QUrl(QStringLiteral("qrc:/qmlprofiler/QmlProfilerFlameGraphView.qml")));
m_content->setClearColor(QColor(0xdc, 0xdc, 0xdc));
m_content->setClearColor(Utils::creatorTheme()->color(Utils::Theme::Timeline_BackgroundColor1));
m_content->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);