File indexing completed on 2024-05-12 04:39:40

0001 /*
0002     SPDX-FileCopyrightText: 2010 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later
0005 */
0006 
0007 #ifndef INCLUDESMODEL_H
0008 #define INCLUDESMODEL_H
0009 
0010 #include <QAbstractListModel>
0011 #include <QStringList>
0012 
0013 class IncludesModel : public QAbstractListModel
0014 {
0015 Q_OBJECT
0016 public:
0017     explicit IncludesModel( QObject* parent = nullptr );
0018     void setIncludes( const QStringList&  );
0019     QStringList includes() const;
0020     QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
0021     int rowCount(const QModelIndex& parent = QModelIndex()) const override;
0022     bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
0023     Qt::ItemFlags flags(const QModelIndex& index) const override;
0024     bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
0025     void addInclude( const QString& );
0026 private:
0027     QStringList m_includes;
0028     void addIncludeInternal( const QString& includePath );
0029 };
0030 
0031 #endif // INCLUDESMODEL_H