Document undefined behavior regarding Qt::ItemNeverHasChildren.

Change-Id: I4c044b206ad6dd57f11d791d8a6a6f3f931acf4f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Stephen Kelly 2013-03-25 14:18:01 +01:00 committed by The Qt Project
parent 771a254d3c
commit f8bf0081d2
2 changed files with 6 additions and 0 deletions

View File

@ -2504,6 +2504,9 @@
to be explicitly set for instances of QListWidgetItem, QTableWidgetItem,
and QTreeWidgetItem.
Note that it is undefined behavior to reimplement QAbstractItemModel::hasChildren
to return true for an index if that index has the Qt::ItemNeverHasChildren flag set.
\sa QAbstractItemModel
*/

View File

@ -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