Differential D4095 Diff 10471 languages/plugins/custom-definesandincludes/kcm_widget/includesmodel.h
Changeset View
Changeset View
Standalone View
Standalone View
languages/plugins/custom-definesandincludes/kcm_widget/includesmodel.h
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include <QAbstractListModel> | 22 | #include <QAbstractListModel> | ||
23 | #include <QStringList> | 23 | #include <QStringList> | ||
24 | 24 | | |||
25 | class IncludesModel : public QAbstractListModel | 25 | class IncludesModel : public QAbstractListModel | ||
26 | { | 26 | { | ||
27 | Q_OBJECT | 27 | Q_OBJECT | ||
28 | public: | 28 | public: | ||
29 | IncludesModel( QObject* parent = nullptr ); | 29 | explicit IncludesModel( QObject* parent = nullptr ); | ||
30 | void setIncludes( const QStringList& ); | 30 | void setIncludes( const QStringList& ); | ||
31 | QStringList includes() const; | 31 | QStringList includes() const; | ||
32 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | 32 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
33 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | 33 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
34 | bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; | 34 | bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; | ||
35 | Qt::ItemFlags flags(const QModelIndex& index) const override; | 35 | Qt::ItemFlags flags(const QModelIndex& index) const override; | ||
36 | bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override; | 36 | bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override; | ||
37 | void addInclude( const QString& ); | 37 | void addInclude( const QString& ); | ||
38 | private: | 38 | private: | ||
39 | QStringList m_includes; | 39 | QStringList m_includes; | ||
40 | void addIncludeInternal( const QString& includePath ); | 40 | void addIncludeInternal( const QString& includePath ); | ||
41 | }; | 41 | }; | ||
42 | 42 | | |||
43 | #endif // INCLUDESMODEL_H | 43 | #endif // INCLUDESMODEL_H |