forked from qt-creator/qt-creator
Core: Add override to models
Change-Id: I89de84e2de0dcce759170d124a214a8d4c004130 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -46,21 +46,21 @@ public:
|
||||
explicit ExternalToolModel(QObject *parent);
|
||||
~ExternalToolModel();
|
||||
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &child) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &modelIndex) const;
|
||||
bool setData(const QModelIndex &modelIndex, const QVariant &value, int role = Qt::EditRole);
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const override;
|
||||
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;
|
||||
Qt::ItemFlags flags(const QModelIndex &modelIndex) const override;
|
||||
bool setData(const QModelIndex &modelIndex, const QVariant &value, int role = Qt::EditRole) override;
|
||||
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
bool dropMimeData(const QMimeData *data,
|
||||
Qt::DropAction action,
|
||||
int row,
|
||||
int column,
|
||||
const QModelIndex &parent);
|
||||
QStringList mimeTypes() const;
|
||||
const QModelIndex &parent) override;
|
||||
QStringList mimeTypes() const override;
|
||||
|
||||
void setTools(const QMap<QString, QList<ExternalTool *> > &tools);
|
||||
QMap<QString, QList<ExternalTool *> > tools() const;
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
QModelIndex addCategory();
|
||||
QModelIndex addTool(const QModelIndex &atIndex);
|
||||
void removeTool(const QModelIndex &modelIndex);
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
Qt::DropActions supportedDropActions() const override;
|
||||
private:
|
||||
QVariant data(ExternalTool *tool, int role = Qt::DisplayRole) const;
|
||||
QVariant data(const QString &category, int role = Qt::DisplayRole) const;
|
||||
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
CategoryModel(QObject *parent = 0);
|
||||
~CategoryModel();
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
void setPages(const QList<IOptionsPage*> &pages,
|
||||
const QList<IOptionsPageProvider *> &providers);
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
{}
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||
};
|
||||
|
||||
bool CategoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
|
||||
@@ -50,16 +50,16 @@ class DocumentModelPrivate : public QAbstractItemModel
|
||||
public:
|
||||
~DocumentModelPrivate();
|
||||
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
QModelIndex parent(const QModelIndex &/*index*/) const { return QModelIndex(); }
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
QModelIndex parent(const QModelIndex &/*index*/) const override { return QModelIndex(); }
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
Qt::DropActions supportedDragActions() const;
|
||||
QStringList mimeTypes() const;
|
||||
Qt::DropActions supportedDragActions() const override;
|
||||
QStringList mimeTypes() const override;
|
||||
|
||||
void addEntry(DocumentModel::Entry *entry);
|
||||
void removeDocument(int idx);
|
||||
|
||||
@@ -40,20 +40,20 @@ class ProxyModel : public QAbstractProxyModel
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ProxyModel(QObject *parent = 0);
|
||||
QModelIndex mapFromSource(const QModelIndex & sourceIndex) const;
|
||||
QModelIndex mapToSource(const QModelIndex & proxyIndex) const;
|
||||
QModelIndex mapFromSource(const QModelIndex & sourceIndex) const override;
|
||||
QModelIndex mapToSource(const QModelIndex & proxyIndex) const override;
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
void setSourceModel(QAbstractItemModel *sourceModel);
|
||||
void setSourceModel(QAbstractItemModel *sourceModel) override;
|
||||
|
||||
// QAbstractProxyModel::sibling is broken in Qt 5
|
||||
QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
|
||||
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
|
||||
// QAbstractProxyModel::supportedDragActions delegation is missing in Qt 5
|
||||
Qt::DropActions supportedDragActions() const;
|
||||
Qt::DropActions supportedDragActions() const override;
|
||||
|
||||
private:
|
||||
void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
||||
|
||||
@@ -47,14 +47,14 @@ public:
|
||||
void setShowReplaceUI(bool show);
|
||||
void setTextEditorFont(const QFont &font, const SearchResultColor &color);
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
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;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
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 setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
|
||||
QModelIndex next(const QModelIndex &idx, bool includeGenerated = false, bool *wrapped = 0) const;
|
||||
QModelIndex prev(const QModelIndex &idx, bool includeGenerated = false, bool *wrapped = 0) const;
|
||||
|
||||
@@ -73,9 +73,9 @@ public:
|
||||
{}
|
||||
|
||||
void clear();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
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;
|
||||
|
||||
void addEntries(const QList<LocatorFilterEntry> &entries);
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ public:
|
||||
: QAbstractTableModel(parent) {}
|
||||
virtual ~MimeTypeSettingsModel() {}
|
||||
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const;
|
||||
virtual QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const;
|
||||
int role = Qt::DisplayRole) const override;
|
||||
virtual QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const override;
|
||||
|
||||
void load();
|
||||
|
||||
|
||||
@@ -83,12 +83,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
int rowCount(const QModelIndex &parent) const
|
||||
int rowCount(const QModelIndex &parent) const override
|
||||
{
|
||||
return parent.isValid() ? 0 : m_themes.size();
|
||||
}
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const
|
||||
QVariant data(const QModelIndex &index, int role) const override
|
||||
{
|
||||
if (role == Qt::DisplayRole)
|
||||
return m_themes.at(index.row()).displayName();
|
||||
|
||||
Reference in New Issue
Block a user