diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-05 17:58:48 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-11-05 18:02:18 +0100 |
commit | a7e4b645dc5b164eb31c22b558ae7a2f5b674afb (patch) | |
tree | c58ac922346363c265ad6873cefe9ed205d84a1d /tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | |
parent | cd542a82b0c2d5c9a4ea167a84e5ea8a25c5d969 (diff) | |
parent | ea0e868c4881944207e9b3a77011e05a505ff3b7 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
src/corelib/global/minimum-linux.S
src/network/access/qhttpthreaddelegate.cpp
src/widgets/kernel/qwidgetwindow.cpp
Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp')
-rw-r--r-- | tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index e9a29d444a..3a676f1275 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -224,15 +224,12 @@ public: return index.isValid() ? qint32(index.internalId()) : qint32(-1); } - bool canFetchMore(const QModelIndex &) const { - return !fetched; - } + bool canFetchMore(const QModelIndex &) const override { return !fetched; } - void fetchMore(const QModelIndex &) { - fetched = true; - } + void fetchMore(const QModelIndex &) override { fetched = true; } - bool hasChildren(const QModelIndex &parent = QModelIndex()) const { + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override + { bool hasFetched = fetched; fetched = true; bool r = QAbstractItemModel::hasChildren(parent); @@ -240,14 +237,16 @@ public: return r; } - int rowCount(const QModelIndex& parent = QModelIndex()) const { + int rowCount(const QModelIndex& parent = QModelIndex()) const override + { if (!fetched) qFatal("%s: rowCount should not be called before fetching", Q_FUNC_INFO); if ((parent.column() > 0) || (level(parent) > levels)) return 0; return rows; } - int columnCount(const QModelIndex& parent = QModelIndex()) const { + int columnCount(const QModelIndex& parent = QModelIndex()) const override + { if ((parent.column() > 0) || (level(parent) > levels)) return 0; return cols; @@ -259,7 +258,7 @@ public: return false; } - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override { if (row < 0 || column < 0 || (level(parent) > levels) || column >= cols || row >= rows) { return QModelIndex(); @@ -269,14 +268,14 @@ public: return i; } - QModelIndex parent(const QModelIndex &index) const + QModelIndex parent(const QModelIndex &index) const override { if (!parentHash.contains(index)) return QModelIndex(); return parentHash[index]; } - QVariant data(const QModelIndex &idx, int role) const + QVariant data(const QModelIndex &idx, int role) const override { if (!idx.isValid()) return QVariant(); |