aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/taskmodel.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2016-02-02 18:26:51 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2016-02-03 08:29:08 +0000
commitf4296d7504e87d291232bc13caa99a439d2393ab (patch)
tree66892ae3ded5333a7036401031effaf228921d3a /src/plugins/projectexplorer/taskmodel.h
parent6a3e687d140cad3dec006b2d5fa8982d4b10f31c (diff)
ProjectExplorer: Modernize
* Use override where appropriate * Use pragma once * Make more constructors explicit Change-Id: I2865fe10f288e3de570826058e43b70a0cb4ee37 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/projectexplorer/taskmodel.h')
-rw-r--r--src/plugins/projectexplorer/taskmodel.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h
index 6be8c130cc..113c388413 100644
--- a/src/plugins/projectexplorer/taskmodel.h
+++ b/src/plugins/projectexplorer/taskmodel.h
@@ -23,8 +23,7 @@
**
****************************************************************************/
-#ifndef TASKMODEL_H
-#define TASKMODEL_H
+#pragma once
#include <QAbstractItemModel>
@@ -41,13 +40,13 @@ class TaskModel : public QAbstractItemModel
public:
// Model stuff
- TaskModel(QObject *parent);
+ explicit TaskModel(QObject *parent);
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
- QModelIndex parent(const QModelIndex &child) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Task task(const QModelIndex &index) const;
QList<Core::Id> categoryIds() const;
@@ -132,11 +131,11 @@ public:
TaskModel *taskModel() { return m_sourceModel; }
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
- QModelIndex parent(const QModelIndex &child) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool filterIncludesUnknowns() const { return m_includeUnknowns; }
void setFilterIncludesUnknowns(bool b) { m_includeUnknowns = b; invalidateFilter(); }
@@ -157,6 +156,7 @@ public:
{ return m_sourceModel->hasFile(mapToSource(index)); }
QModelIndex mapFromSource(const QModelIndex &idx) const;
+
private:
void handleNewRows(const QModelIndex &index, int first, int last);
void handleRowsAboutToBeRemoved(const QModelIndex &index, int first, int last);
@@ -180,5 +180,3 @@ private:
} // namespace Internal
} // namespace ProjectExplorer
-
-#endif // TASKMODEL_H