From 9dfba89c28bbff3316cb7aed6c07f90c0f2d5a22 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 26 Sep 2012 18:16:08 +0200 Subject: Add implementations of QAIM::sibling in public APIs. Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62 Reviewed-by: Marc Mutz Reviewed-by: Stephen Kelly --- src/corelib/itemmodels/qstringlistmodel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/corelib/itemmodels/qstringlistmodel.cpp') diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index 2bea97d4b4..49345f155a 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -126,6 +126,17 @@ int QStringListModel::rowCount(const QModelIndex &parent) const return lst.count(); } +/*! + \reimp +*/ +QModelIndex QStringListModel::sibling(int row, int column, const QModelIndex &idx) const +{ + if (!idx.isValid() || column != 0 || row >= lst.count()) + return QModelIndex(); + + return createIndex(row, 0); +} + /*! Returns data for the specified \a role, from the item with the given \a index. -- cgit v1.2.3