summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-09-25 14:33:33 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-09-25 14:40:33 (GMT)
commitb4c52810efd42ba9cd8087180a5bf9d48c18de84 (patch)
treef5467bea45389a766b4083d68a1be08e6ae18f25 /src/corelib/kernel
parent9e389da2e1c46906df9f1427af4dc311e4ac64e5 (diff)
downloadQt-b4c52810efd42ba9cd8087180a5bf9d48c18de84.zip
Qt-b4c52810efd42ba9cd8087180a5bf9d48c18de84.tar.gz
Qt-b4c52810efd42ba9cd8087180a5bf9d48c18de84.tar.bz2
Doc: Added some notes to help people implement custom models.
Reviewed-by: Trust Me
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index ce6c844..8e2273d 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1226,6 +1226,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
/*!
\fn bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent)
+ \note The base class implementation of this function does nothing and
+ returns false.
+
Inserts a single row before the given \a row in the child items of the
\a parent specified.
@@ -1834,6 +1837,9 @@ void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions)
}
/*!
+ \note The base class implementation of this function does nothing and
+ returns false.
+
On models that support this, inserts \a count rows into the model before
the given \a row. Items in the new row will be children of the item
represented by the \a parent model index.
@@ -1849,11 +1855,11 @@ void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions)
Returns true if the rows were successfully inserted; otherwise returns
false.
- The base class implementation does nothing and returns false.
-
If you implement your own model, you can reimplement this function if you
want to support insertions. Alternatively, you can provide your own API for
- altering the data.
+ altering the data. In either case, you will need to call
+ beginInsertRows() and endInsertRows() to notify other components that the
+ model has changed.
\sa insertColumns(), removeRows(), beginInsertRows(), endInsertRows()
*/