File indexing completed on 2024-03-24 04:38:32
0001 /* This file is part of KDevelop 0002 * Copyright 2011 Mathieu Lornac <mathieu.lornac@gmail.com> 0003 * Copyright 2011 Damien Coppel <damien.coppel@gmail.com> 0004 * Copyright 2011 Lionel Duc <lionel.data@gmail.com> 0005 * Copyright 2017 Anton Anikin <anton@anikin.xyz> 0006 0007 This program is free software; you can redistribute it and/or 0008 modify it under the terms of the GNU General Public 0009 License as published by the Free Software Foundation; either 0010 version 2 of the License, or (at your option) any later version. 0011 0012 This program is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 General Public License for more details. 0016 0017 You should have received a copy of the GNU General Public License 0018 along with this program; see the file COPYING. If not, write to 0019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 Boston, MA 02110-1301, USA. 0021 */ 0022 0023 #pragma once 0024 0025 #include <QAbstractTableModel> 0026 0027 namespace Valgrind 0028 { 0029 0030 class MassifSnapshot; 0031 0032 class MassifSnapshotsModel : public QAbstractTableModel 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 explicit MassifSnapshotsModel(QObject* parent = nullptr); 0038 ~MassifSnapshotsModel() override; 0039 0040 QModelIndex index(int, int, const QModelIndex& parent = QModelIndex()) const override; 0041 0042 int rowCount(const QModelIndex& parent = QModelIndex()) const override; 0043 int columnCount(const QModelIndex& parent = QModelIndex()) const override; 0044 0045 QVariant data(const QModelIndex& index, int role) const override; 0046 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 0047 0048 void addSnapshot(MassifSnapshot* snapshot); 0049 0050 private: 0051 QList<MassifSnapshot*> m_snapshots; 0052 }; 0053 0054 }