summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp16
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 88e39f9441..43b51bcaf5 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -3345,6 +3345,14 @@ QModelIndex QAbstractTableModel::parent(const QModelIndex &) const
return QModelIndex();
}
+/*!
+ \reimp
+*/
+QModelIndex QAbstractTableModel::sibling(int row, int column, const QModelIndex &) const
+{
+ return index(row, column);
+}
+
bool QAbstractTableModel::hasChildren(const QModelIndex &parent) const
{
if (parent.model() == this || !parent.isValid())
@@ -3488,6 +3496,14 @@ QModelIndex QAbstractListModel::parent(const QModelIndex & /* index */) const
/*!
\reimp
+*/
+QModelIndex QAbstractListModel::sibling(int row, int column, const QModelIndex &) const
+{
+ return index(row, column);
+}
+
+/*!
+ \reimp
*/
Qt::ItemFlags QAbstractListModel::flags(const QModelIndex &index) const
{
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index 7d8c1ff113..f1f67c9412 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -417,6 +417,7 @@ public:
~QAbstractTableModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
@@ -442,6 +443,7 @@ public:
~QAbstractListModel();
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;