File indexing completed on 2024-05-05 05:51:37

0001 /*
0002     SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include <QAbstractTableModel>
0009 #include <QIcon>
0010 #include <QString>
0011 
0012 struct SymbolItem {
0013     QString name;
0014     int line;
0015     QIcon icon;
0016 };
0017 
0018 class GotoSymbolModel : public QAbstractTableModel
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit GotoSymbolModel(QObject *parent = nullptr);
0024 
0025     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0026     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0027     QVariant data(const QModelIndex &index, int role) const override;
0028 
0029     void refresh(const QString &filePath);
0030 
0031 private:
0032     QList<SymbolItem> m_rows;
0033 };