From f8bf0081d2569ef08f5c5b3ee3b9c182d11e65cf Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Mar 2013 14:18:01 +0100 Subject: Document undefined behavior regarding Qt::ItemNeverHasChildren. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4c044b206ad6dd57f11d791d8a6a6f3f931acf4f Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Olivier Goffart --- src/corelib/itemmodels/qabstractitemmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/itemmodels/qabstractitemmodel.cpp') diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 0d67c1f17b..f152dec5e6 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1679,6 +1679,9 @@ bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent Use rowCount() on the parent to find out the number of children. + Note that it is undefined behavior to report that a particular index hasChildren + with this method if the same index has the flag Qt::ItemNeverHasChildren set. + \sa parent(), index() */ bool QAbstractItemModel::hasChildren(const QModelIndex &parent) const -- cgit v1.2.3