KDEUI
kmodelindexproxymapper.cpp
Go to the documentation of this file.
33 KModelIndexProxyMapperPrivate(const QAbstractItemModel *leftModel, const QAbstractItemModel *rightModel, KModelIndexProxyMapper *qq)
65 The idea here is that <tt>this</tt> selection model and proxySelectionModel might be in different parts of the
93 We first build the chain from 1 to 5, then start building the chain from 7 to 1. We stop when we find that proxy 2 is
110 QWeakPointer<const QAbstractProxyModel> selectionTargetProxyModel = qobject_cast<const QAbstractProxyModel*>(targetModel.data());
115 selectionTargetProxyModel = qobject_cast<const QAbstractProxyModel*>(selectionTargetProxyModel.data()->sourceModel());
125 QWeakPointer<const QAbstractProxyModel> sourceProxyModel = qobject_cast<const QAbstractProxyModel*>(sourceModel.data());
131 sourceProxyModel = qobject_cast<const QAbstractProxyModel*>(sourceProxyModel.data()->sourceModel());
157 Q_ASSERT( m_proxyChainDown.first().data()->sourceModel() == m_proxyChainUp.last().data()->sourceModel() );
162 KModelIndexProxyMapper::KModelIndexProxyMapper(const QAbstractItemModel* leftModel, const QAbstractItemModel* rightModel, QObject* parent)
213 QItemSelection KModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelection& selection) const
221 kDebug() << "FAIL" << selection.first().model() << d->m_leftModel.data() << d->m_rightModel.data();
256 Q_ASSERT( ( !seekSelection.isEmpty() && seekSelection.first().model() == d->m_rightModel.data() ) || true );
260 QItemSelection KModelIndexProxyMapper::mapSelectionRightToLeft(const QItemSelection& selection) const
268 kDebug() << "FAIL" << selection.first().model() << d->m_leftModel.data() << d->m_rightModel.data();
305 Q_ASSERT( ( !seekSelection.isEmpty() && seekSelection.first().model() == d->m_leftModel.data() ) || true );
QModelIndexList indexes() const
~KModelIndexProxyMapper()
Definition: kmodelindexproxymapper.cpp:168
QModelIndex mapLeftToRight(const QModelIndex &index) const
Maps the index from the left model to the right model.
Definition: kmodelindexproxymapper.cpp:173
const T & next()
const T & previous()
T * data() const
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
int size() const
int indexOf(const T &value, int from) const
bool isEmpty() const
void toBack()
T & first()
bool hasPrevious() const
This class facilitates easy mapping of indexes and selections through proxy models.
Definition: kmodelindexproxymapper.h:79
QModelIndex mapRightToLeft(const QModelIndex &index) const
Maps the index from the right model to the left model.
Definition: kmodelindexproxymapper.cpp:182
QList< T > mid(int pos, int length) const
QItemSelection mapSelectionRightToLeft(const QItemSelection &selection) const
Maps the selection from the right model to the left model.
Definition: kmodelindexproxymapper.cpp:260
static QItemSelection removeInvalidRanges(const QItemSelection &selection)
Definition: kmodelindexproxymapper.cpp:200
void prepend(const T &value)
QItemSelection mapSelectionLeftToRight(const QItemSelection &selection) const
Maps the selection from the left model to the right model.
Definition: kmodelindexproxymapper.cpp:213
bool isValid() const
KModelIndexProxyMapper(const QAbstractItemModel *leftModel, const QAbstractItemModel *rightModel, QObject *parent=0)
Constructor.
Definition: kmodelindexproxymapper.cpp:162
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.