2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-04-04 14:39:29 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-04-04 14:39:29 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QGraphicsView>
|
2011-04-04 14:39:29 +02:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QAbstractItemModel;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Valgrind {
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Callgrind { class Function; }
|
2011-04-04 14:39:29 +02:00
|
|
|
}
|
|
|
|
|
|
2011-05-23 13:50:28 +02:00
|
|
|
namespace Valgrind {
|
2011-04-04 14:39:29 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2018-08-01 12:15:04 +02:00
|
|
|
class Visualization : public QGraphicsView
|
2011-04-04 14:39:29 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-12-10 08:11:18 +01:00
|
|
|
explicit Visualization(QWidget *parent = nullptr);
|
|
|
|
|
~Visualization() override;
|
2011-04-04 14:39:29 +02:00
|
|
|
|
2011-05-18 17:05:49 +02:00
|
|
|
void setModel(QAbstractItemModel *model);
|
2011-04-04 14:39:29 +02:00
|
|
|
|
|
|
|
|
const Valgrind::Callgrind::Function *functionForItem(QGraphicsItem *item) const;
|
|
|
|
|
QGraphicsItem *itemForFunction(const Valgrind::Callgrind::Function *function) const;
|
|
|
|
|
|
|
|
|
|
void setFunction(const Valgrind::Callgrind::Function *function);
|
|
|
|
|
const Valgrind::Callgrind::Function *function() const;
|
|
|
|
|
|
2011-05-11 16:26:34 +02:00
|
|
|
void setMinimumInclusiveCostRatio(double ratio);
|
|
|
|
|
|
2011-04-04 14:39:29 +02:00
|
|
|
void setText(const QString &message);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void functionActivated(const Valgrind::Callgrind::Function *);
|
|
|
|
|
void functionSelected(const Valgrind::Callgrind::Function *);
|
|
|
|
|
|
|
|
|
|
protected:
|
2017-03-19 20:10:35 +02:00
|
|
|
void populateScene();
|
2018-12-10 08:11:18 +01:00
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
2011-04-04 14:39:29 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class Private;
|
|
|
|
|
Private *d;
|
|
|
|
|
};
|
|
|
|
|
|
2011-05-20 09:12:34 +02:00
|
|
|
} // namespace Internal
|
2011-05-23 13:50:28 +02:00
|
|
|
} // namespace Valgrind
|