QmlProfiler: Remove QmlProfilerTreeView

It doesn't really do anything useful.

Change-Id: I84472d4baaf291a2daee145ef69ee39a836eff7c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-07-01 18:04:26 +02:00
parent a4da263a1f
commit bc7dca220f
6 changed files with 86 additions and 182 deletions

View File

@@ -28,7 +28,6 @@ SOURCES += \
qmlprofilertool.cpp \
qmlprofilertracefile.cpp \
qmlprofilertraceview.cpp \
qmlprofilertreeview.cpp \
qmlprofilerviewmanager.cpp
HEADERS += \
@@ -58,7 +57,6 @@ HEADERS += \
qmlprofilertool.h \
qmlprofilertracefile.h \
qmlprofilertraceview.h \
qmlprofilertreeview.h \
qmlprofilerviewmanager.h
RESOURCES += \

View File

@@ -44,7 +44,6 @@ QtcPlugin {
"qmlprofilertool.cpp", "qmlprofilertool.h",
"qmlprofilertracefile.cpp", "qmlprofilertracefile.h",
"qmlprofilertraceview.cpp", "qmlprofilertraceview.h",
"qmlprofilertreeview.cpp", "qmlprofilertreeview.h",
"qmlprofilerviewmanager.cpp", "qmlprofilerviewmanager.h",
]
}

View File

@@ -128,6 +128,57 @@ public:
qint64 rangeEnd;
};
static void setViewDefaults(Utils::TreeView *view)
{
view->setFrameStyle(QFrame::NoFrame);
QHeaderView *header = view->header();
header->setSectionResizeMode(QHeaderView::Interactive);
header->setDefaultSectionSize(100);
header->setMinimumSectionSize(50);
}
static QString displayHeader(Fields header)
{
static const char ctxt[] = "QmlProfiler::Internal::QmlProfilerEventsMainView";
switch (header) {
case Callee:
return QCoreApplication::translate(ctxt, "Callee");
case CalleeDescription:
return QCoreApplication::translate(ctxt, "Callee Description");
case Caller:
return QCoreApplication::translate(ctxt, "Caller");
case CallerDescription:
return QCoreApplication::translate(ctxt, "Caller Description");
case CallCount:
return QCoreApplication::translate(ctxt, "Calls");
case Details:
return QCoreApplication::translate(ctxt, "Details");
case Location:
return QCoreApplication::translate(ctxt, "Location");
case MaxTime:
return QCoreApplication::translate(ctxt, "Longest Time");
case TimePerCall:
return QCoreApplication::translate(ctxt, "Mean Time");
case SelfTime:
return QCoreApplication::translate(ctxt, "Self Time");
case SelfTimeInPercent:
return QCoreApplication::translate(ctxt, "Self Time in Percent");
case MinTime:
return QCoreApplication::translate(ctxt, "Shortest Time");
case TimeInPercent:
return QCoreApplication::translate(ctxt, "Time in Percent");
case TotalTime:
return QCoreApplication::translate(ctxt, "Total Time");
case Type:
return QCoreApplication::translate(ctxt, "Type");
case MedianTime:
return QCoreApplication::translate(ctxt, "Median Time");
default:
return QString();
}
}
QmlProfilerEventsWidget::QmlProfilerEventsWidget(QWidget *parent,
QmlProfilerTool *profilerTool,
QmlProfilerViewManager *container,
@@ -347,9 +398,10 @@ public:
};
QmlProfilerEventsMainView::QmlProfilerEventsMainView(QWidget *parent,
QmlProfilerEventsModelProxy *modelProxy)
: QmlProfilerTreeView(parent), d(new QmlProfilerEventsMainViewPrivate(this))
QmlProfilerEventsModelProxy *modelProxy) :
Utils::TreeView(parent), d(new QmlProfilerEventsMainViewPrivate(this))
{
setViewDefaults(this);
setObjectName(QLatin1String("QmlProfilerEventsTable"));
setSortingEnabled(false);
@@ -830,9 +882,10 @@ public:
};
QmlProfilerEventRelativesView::QmlProfilerEventRelativesView(
QmlProfilerEventRelativesModelProxy *modelProxy, QWidget *parent)
: QmlProfilerTreeView(parent), d(new QmlProfilerEventParentsViewPrivate(this))
QmlProfilerEventRelativesModelProxy *modelProxy, QWidget *parent) :
Utils::TreeView(parent), d(new QmlProfilerEventParentsViewPrivate(this))
{
setViewDefaults(this);
setSortingEnabled(false);
d->modelProxy = modelProxy;
QStandardItemModel *model = new QStandardItemModel(this);

View File

@@ -31,16 +31,16 @@
#ifndef QMLPROFILEREVENTVIEW_H
#define QMLPROFILEREVENTVIEW_H
#include <QStandardItemModel>
#include <qmldebug/qmlprofilereventtypes.h>
#include "qmlprofilermodelmanager.h"
#include "qmlprofilereventsmodelproxy.h"
#include "qmlprofilertreeview.h"
#include <analyzerbase/ianalyzertool.h>
#include "qmlprofilerviewmanager.h"
#include <qmldebug/qmlprofilereventtypes.h>
#include <analyzerbase/ianalyzertool.h>
#include <utils/itemviews.h>
#include <QStandardItemModel>
namespace QmlProfiler {
namespace Internal {
@@ -56,6 +56,27 @@ enum ItemRole {
ColumnRole
};
enum Fields {
Name,
Callee,
CalleeDescription,
Caller,
CallerDescription,
CallCount,
Details,
Location,
MaxTime,
TimePerCall,
SelfTime,
SelfTimeInPercent,
MinTime,
TimeInPercent,
TotalTime,
Type,
MedianTime,
MaxFields
};
class QmlProfilerEventsWidget : public QWidget
{
Q_OBJECT
@@ -100,7 +121,7 @@ private:
QmlProfilerEventsWidgetPrivate *d;
};
class QmlProfilerEventsMainView : public QmlProfilerTreeView
class QmlProfilerEventsMainView : public Utils::TreeView
{
Q_OBJECT
public:
@@ -150,7 +171,7 @@ private:
};
class QmlProfilerEventRelativesView : public QmlProfilerTreeView
class QmlProfilerEventRelativesView : public Utils::TreeView
{
Q_OBJECT
public:

View File

@@ -1,94 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "qmlprofilertreeview.h"
#include <utils/itemviews.h>
#include <QCoreApplication>
#include <QHeaderView>
namespace QmlProfiler {
namespace Internal {
QmlProfilerTreeView::QmlProfilerTreeView(QWidget *parent)
: Utils::TreeView(parent)
{
setFrameStyle(QFrame::NoFrame);
header()->setSectionResizeMode(QHeaderView::Interactive);
header()->setDefaultSectionSize(100);
header()->setMinimumSectionSize(50);
}
// Translate from "old" context to keep 2.8 string freeze
QString QmlProfilerTreeView::displayHeader(Fields header) const
{
static const char ctxt1[] = "QmlProfiler::Internal::QmlProfilerEventsParentsAndChildrenView";
static const char ctxt2[] = "QmlProfiler::Internal::QmlProfilerEventsMainView";
switch (header) {
case Callee:
return QCoreApplication::translate(ctxt1, "Callee");
case CalleeDescription:
return QCoreApplication::translate(ctxt1, "Callee Description");
case Caller:
return QCoreApplication::translate(ctxt1, "Caller");
case CallerDescription:
return QCoreApplication::translate(ctxt1, "Caller Description");
case CallCount:
return QCoreApplication::translate(ctxt2, "Calls");
case Details:
return QCoreApplication::translate(ctxt2, "Details");
case Location:
return QCoreApplication::translate(ctxt2, "Location");
case MaxTime:
return QCoreApplication::translate(ctxt2, "Longest Time");
case TimePerCall:
return QCoreApplication::translate(ctxt2, "Mean Time");
case SelfTime:
return QCoreApplication::translate(ctxt2, "Self Time");
case SelfTimeInPercent:
return QCoreApplication::translate(ctxt2, "Self Time in Percent");
case MinTime:
return QCoreApplication::translate(ctxt2, "Shortest Time");
case TimeInPercent:
return QCoreApplication::translate(ctxt2, "Time in Percent");
case TotalTime:
return QCoreApplication::translate(ctxt2, "Total Time");
case Type:
return QCoreApplication::translate(ctxt2, "Type");
case MedianTime:
return QCoreApplication::translate(ctxt2, "Median Time");
default:
return QString();
}
}
} // namespace Internal
} // namespace QmlProfiler

View File

@@ -1,73 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLPROFILERTREEVIEW
#define QMLPROFILERTREEVIEW
#include <utils/itemviews.h>
namespace QmlProfiler {
namespace Internal {
class QmlProfilerTreeView : public Utils::TreeView
{
Q_OBJECT
protected:
QmlProfilerTreeView(QWidget *parent = 0);
enum Fields {
Name,
Callee,
CalleeDescription,
Caller,
CallerDescription,
CallCount,
Details,
Location,
MaxTime,
TimePerCall,
SelfTime,
SelfTimeInPercent,
MinTime,
TimeInPercent,
TotalTime,
Type,
MedianTime,
MaxFields
};
QString displayHeader(Fields header) const;
};
} // namespace Internal
} // namespace QmlProfiler
#endif // QMLPROFILERTREEVIEW