* drop a bogus QChar::NoCategory enum value; the proper QChar::Other_NotAssigned
value is returned for an unassigned codepoints now.
+* layoutAboutToBeChanged is no longer emitted by QAbstractItemModel::beginMoveRows.
+ layoutChanged is no longer emitted by QAbstractItemModel::endMoveRows. Proxy models
+ should now also connect to (and disconnect from) the rowsAboutToBeMoved and
+ rowsMoved signals.
+
QtGui
-----
* Accessibility has been refactored. The hierachy of accessible objects is implemented via
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 first and last
d->changes.push(destinationChange);
emit rowsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
- emit layoutAboutToBeChanged();
d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
return true;
}
function \e after moving data within the model's underlying data
store.
- layoutChanged is emitted by this method for compatibility reasons.
-
\sa beginMoveRows()
\since 4.6
d->itemsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first, Qt::Vertical);
emit rowsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first);
- emit layoutChanged();
}
/*!
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 first and last
d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Horizontal);
emit columnsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
- emit layoutAboutToBeChanged();
return true;
}
function \e after moving data within the model's underlying data
store.
- layoutChanged is emitted by this method for compatibility reasons.
-
\sa beginMoveColumns()
\since 4.6
d->itemsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first, Qt::Horizontal);
emit columnsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first);
- emit layoutChanged();
}
/*!
#endif
}
+void QAbstractItemViewPrivate::_q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)
+{
+ _q_layoutChanged();
+}
+
+void QAbstractItemViewPrivate::_q_columnsMoved(const QModelIndex &, int, int, const QModelIndex &, int)
+{
+ _q_layoutChanged();
+}
+
/*!
This slot is called when the selection is changed. The previous
selection (which may be empty), is specified by \a deselected, and the
Q_PRIVATE_SLOT(d_func(), void _q_columnsInserted(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex&, int, int))
+ Q_PRIVATE_SLOT(d_func(), void _q_columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int))
+ Q_PRIVATE_SLOT(d_func(), void _q_rowsMoved(const QModelIndex&, int, int, const QModelIndex&, int))
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged())
Q_PRIVATE_SLOT(d_func(), void _q_headerDataChanged())
virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end);
virtual void _q_modelDestroyed();
virtual void _q_layoutChanged();
+ virtual void _q_rowsMoved(const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart);
+ virtual void _q_columnsMoved(const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart);
+
void _q_headerDataChanged() { doDelayedItemsLayout(); }
void _q_scrollerStateChanged();
class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate
{
QIdentityProxyModelPrivate()
- : ignoreNextLayoutAboutToBeChanged(false),
- ignoreNextLayoutChanged(false)
{
}
Q_DECLARE_PUBLIC(QIdentityProxyModel)
- bool ignoreNextLayoutAboutToBeChanged;
- bool ignoreNextLayoutChanged;
QList<QPersistentModelIndex> layoutChangePersistentIndexes;
QModelIndexList proxyIndexes;
void QIdentityProxyModelPrivate::_q_sourceLayoutAboutToBeChanged()
{
- if (ignoreNextLayoutAboutToBeChanged)
- return;
-
Q_Q(QIdentityProxyModel);
foreach(const QPersistentModelIndex &proxyPersistentIndex, q->persistentIndexList()) {
void QIdentityProxyModelPrivate::_q_sourceLayoutChanged()
{
- if (ignoreNextLayoutChanged)
- return;
-
Q_Q(QIdentityProxyModel);
for (int i = 0; i < proxyIndexes.size(); ++i) {
q, SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int)));
QObject::connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
q, SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int)));
+ QObject::connect(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ q, SLOT(_q_layoutAboutToBeChanged()));
+ QObject::connect(model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ q, SLOT(_q_layoutAboutToBeChanged()));
+ QObject::connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ q, SLOT(_q_layoutChanged()));
+ QObject::connect(model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
+ q, SLOT(_q_layoutChanged()));
QObject::connect(model, SIGNAL(layoutAboutToBeChanged()),
q, SLOT(_q_layoutAboutToBeChanged()));
QObject::connect(model, SIGNAL(layoutChanged()),
disconnect(d->model, SIGNAL(layoutChanged()),
this, SLOT(_q_sourceLayoutChanged()));
+ disconnect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutAboutToBeChanged()));
+
+ disconnect(d->model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutChanged()));
+
+ disconnect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutAboutToBeChanged()));
+
+ disconnect(d->model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutChanged()));
+
disconnect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset()));
disconnect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset()));
connect(d->model, SIGNAL(layoutChanged()),
this, SLOT(_q_sourceLayoutChanged()));
+ connect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutAboutToBeChanged()));
+
+ connect(d->model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutChanged()));
+
+ connect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutAboutToBeChanged()));
+
+ connect(d->model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_sourceLayoutChanged()));
+
connect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset()));
connect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset()));