summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-01 10:30:28 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-01 10:30:28 (GMT)
commit0b034e816994f3c6ad5ba5e0e9f7c0c60ab9440d (patch)
treefab841dffc36c6eae3d7db5a6db2a113d613d2a7 /src/corelib
parent532861d77b661f332e5a16c031926da38a813ec5 (diff)
parent4e85c1015c2dfa58560e0567af4fa17a412441a5 (diff)
downloadQt-0b034e816994f3c6ad5ba5e0e9f7c0c60ab9440d.zip
Qt-0b034e816994f3c6ad5ba5e0e9f7c0c60ab9440d.tar.gz
Qt-0b034e816994f3c6ad5ba5e0e9f7c0c60ab9440d.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Doc: Fixed a typo Doc: QAbstractItemModel: note unexpected behavior with beginMoveRows Added environment variable graphicssystem switch. Fixed a problem where QPixmaps where re-bound in non-sharing contexts. Fix bug in QGraphicsItem::scroll() when called with no QRectF argument. Make sure we don't pull inn /usr/X11 stuff in the qws mkspek conf Avoid unnecessary detach / deep copy in QGraphicsItem::scroll().
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp92
1 files changed, 52 insertions, 40 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 24c26b6..b0e2f48 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2508,29 +2508,35 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
- required to do yourself.
-
- Using beginMoveRows and endMoveRows is an alternative to emitting
- layoutAboutToBeChanged and layoutChanged directly along with
- changePersistentIndexes. layoutAboutToBeChanged is emitted by
- this method for compatibility reasons.
+ required to do yourself. Using beginMoveRows and endMoveRows
+ is an alternative to emitting layoutAboutToBeChanged and
+ layoutChanged directly along with changePersistentIndexes.
+ layoutAboutToBeChanged is emitted by this method for compatibility
+ reasons.
The \a sourceParent index corresponds to the parent from which the
- rows are moved; \a sourceFirst and \a sourceLast are the row
- numbers of the rows to be moved. The \a destinationParent index
- corresponds to the parent into which the rows are moved. The \a
+ rows are moved; \a sourceFirst and \a sourceLast are the first and last
+ row numbers of the rows to be moved. The \a destinationParent index
+ corresponds to the parent into which those rows are moved. The \a
destinationChild is the row to which the rows will be moved. That
is, the index at row \a sourceFirst in \a sourceParent will become
- row \a destinationChild in \a destinationParent. Its siblings will
- be moved correspondingly.
-
- Note that \a sourceParent and \a destinationParent may be the
- same, in which case you must ensure that the \a destinationChild is
- not within the range of \a sourceFirst and \a sourceLast. You
- must also ensure that you do not attempt to move a row to one of
- its own children or ancestors. This method returns false if either
- condition is true, in which case you should abort your move
- operation.
+ row \a destinationChild in \a destinationParent, followed by all other
+ rows up to \a sourceLast.
+
+ However, when moving rows down in the same parent (\a sourceParent
+ and \a destinationParent are equal), the rows will be placed before the
+ \a destinationChild index. That is, if you wish to move rows 0 and 1 so
+ they will become rows 1 and 2, \a destinationChild should be 3. In this
+ case, the new index for the source row \c i (which is between
+ \a sourceFirst and \a sourceLast) is equal to
+ \c {(destinationChild-sourceLast-1+i)}.
+
+ Note that if \a sourceParent and \a destinationParent are the same,
+ you must ensure that the \a destinationChild is not within the range
+ of \a sourceFirst and \a sourceLast + 1. You must also ensure that you
+ do not attempt to move a row to one of its own children or ancestors.
+ This method returns false if either condition is true, in which case you
+ should abort your move operation.
\table 80%
\row
@@ -2761,29 +2767,35 @@ void QAbstractItemModel::endRemoveColumns()
When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
- required to do yourself.
-
- Using beginMoveColumns and endMoveColumns is an alternative to
- emitting layoutAboutToBeChanged and layoutChanged directly along
- with changePersistentIndexes. layoutAboutToBeChanged is emitted
- by this method for compatibility reasons.
+ required to do yourself. Using beginMoveRows and endMoveRows
+ is an alternative to emitting layoutAboutToBeChanged and
+ layoutChanged directly along with changePersistentIndexes.
+ layoutAboutToBeChanged is emitted by this method for compatibility
+ reasons.
The \a sourceParent index corresponds to the parent from which the
- columns are moved; \a sourceFirst and \a sourceLast are the column
- numbers of the columns to be moved. The \a destinationParent index
- corresponds to the parent into which the columns are moved. The \a
- destinationChild is the column to which the columns will be
- moved. That is, the index at column \a sourceFirst in \a
- sourceParent will become column \a destinationChild in \a
- destinationParent. Its siblings will be moved correspondingly.
-
- Note that \a sourceParent and \a destinationParent may be the
- same, in which case you must ensure that the \a destinationChild
- is not within the range of \a sourceFirst and \a sourceLast. You
- must also ensure that you do not attempt to move a row to one of
- its own chilren or ancestors. This method returns false if either
- condition is true, in which case you should abort your move
- operation.
+ columns are moved; \a sourceFirst and \a sourceLast are the first and last
+ column numbers of the columns to be moved. The \a destinationParent index
+ corresponds to the parent into which those columns are moved. The \a
+ destinationChild is the column to which the columns will be moved. That
+ is, the index at column \a sourceFirst in \a sourceParent will become
+ column \a destinationChild in \a destinationParent, followed by all other
+ columns up to \a sourceLast.
+
+ However, when moving columns down in the same parent (\a sourceParent
+ and \a destinationParent are equal), the columnss will be placed before the
+ \a destinationChild index. That is, if you wish to move columns 0 and 1 so
+ they will become columns 1 and 2, \a destinationChild should be 3. In this
+ case, the new index for the source column \c i (which is between
+ \a sourceFirst and \a sourceLast) is equal to
+ \c {(destinationChild-sourceLast-1+i)}.
+
+ Note that if \a sourceParent and \a destinationParent are the same,
+ you must ensure that the \a destinationChild is not within the range
+ of \a sourceFirst and \a sourceLast + 1. You must also ensure that you
+ do not attempt to move a column to one of its own children or ancestors.
+ This method returns false if either condition is true, in which case you
+ should abort your move operation.
\sa endMoveColumns()