2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-04-04 14:39:27 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-04-04 14:39:27 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-04-04 14:39:27 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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 Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-04-04 14:39:27 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-04-04 14:39:27 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-04-04 14:39:27 +02:00
|
|
|
|
|
|
|
|
#ifndef VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H
|
|
|
|
|
#define VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QAbstractItemModel>
|
2011-04-04 14:39:27 +02:00
|
|
|
|
|
|
|
|
#include "callgrindabstractmodel.h"
|
|
|
|
|
|
|
|
|
|
namespace Valgrind {
|
|
|
|
|
namespace Callgrind {
|
|
|
|
|
|
|
|
|
|
class FunctionCall;
|
|
|
|
|
class Function;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Model to display list of function calls.
|
|
|
|
|
*/
|
2011-07-05 10:40:37 +02:00
|
|
|
class CallModel : public QAbstractItemModel
|
2011-04-04 14:39:27 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-04-05 11:11:57 +02:00
|
|
|
explicit CallModel(QObject *parent);
|
2011-04-04 14:39:27 +02:00
|
|
|
virtual ~CallModel();
|
|
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
/// Only one cost event column will be shown, this decides which one it is.
|
|
|
|
|
/// By default it is the first event in the @c ParseData, i.e. 0.
|
|
|
|
|
virtual int costEvent() const;
|
2011-04-05 11:11:57 +02:00
|
|
|
virtual void setCostEvent(int event);
|
2011-04-04 14:39:27 +02:00
|
|
|
|
|
|
|
|
virtual void setParseData(const ParseData *data);
|
|
|
|
|
virtual const ParseData *parseData() const;
|
|
|
|
|
|
|
|
|
|
void setCalls(const QVector<const FunctionCall *> &calls, const Function *function);
|
|
|
|
|
QVector<const FunctionCall *> calls() const;
|
|
|
|
|
const Function *function() const;
|
|
|
|
|
|
|
|
|
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
virtual QModelIndex parent(const QModelIndex &child) const;
|
|
|
|
|
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
|
|
|
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
|
|
enum Columns {
|
|
|
|
|
CallerColumn,
|
|
|
|
|
CalleeColumn,
|
|
|
|
|
CallsColumn,
|
|
|
|
|
CostColumn,
|
|
|
|
|
ColumnCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum Roles {
|
2011-04-05 11:11:57 +02:00
|
|
|
FunctionCallRole = NextCustomRole
|
2011-04-04 14:39:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class Private;
|
|
|
|
|
Private *d;
|
|
|
|
|
};
|
|
|
|
|
|
2011-05-18 17:05:49 +02:00
|
|
|
} // namespace Callgrind
|
|
|
|
|
} // namespace Valgrind
|
2011-04-04 14:39:27 +02:00
|
|
|
|
|
|
|
|
#endif // VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H
|