digiKam
|
Signals | |
void | isConnectedChanged () |
Public Member Functions | |
GPSModelIndexProxyMapper (const QAbstractItemModel *const leftModel, const QAbstractItemModel *const rightModel, QObject *const parent=nullptr) | |
bool | isConnected () const |
QModelIndex | mapLeftToRight (const QModelIndex &index) const |
QModelIndex | mapRightToLeft (const QModelIndex &index) const |
QItemSelection | mapSelectionLeftToRight (const QItemSelection &selection) const |
QItemSelection | mapSelectionRightToLeft (const QItemSelection &selection) const |
~GPSModelIndexProxyMapper () override | |
Properties | |
bool | isConnected |
This class facilitates easy mapping of indexes and selections through proxy models.
In a complex system of proxy models there can be a need to map indexes and selections between them, and sometimes to do so without knowledge of the path from one model to another.
If there is a need to map indexes between proxy 2 and proxy 4, a GPSModelIndexProxyMapper can be created to facilitate mapping of indexes between them.
Note that the aim is to achieve black box connections so that there is no need for application code to know the structure of proxy models in the path between left and right and attempt to manually map them.
The isConnected property indicates whether there is a path from the left side to the right side.
|
explicit |
|
override |
bool Digikam::GPSModelIndexProxyMapper::isConnected | ( | ) | const |
|
signal |
QModelIndex Digikam::GPSModelIndexProxyMapper::mapLeftToRight | ( | const QModelIndex & | index | ) | const |
Maps the index
from the left model to the right model.
References mapSelectionLeftToRight().
QModelIndex Digikam::GPSModelIndexProxyMapper::mapRightToLeft | ( | const QModelIndex & | index | ) | const |
Maps the index
from the right model to the left model.
References mapSelectionRightToLeft().
QItemSelection Digikam::GPSModelIndexProxyMapper::mapSelectionLeftToRight | ( | const QItemSelection & | selection | ) | const |
Maps the selection
from the left model to the right model.
Referenced by mapLeftToRight().
QItemSelection Digikam::GPSModelIndexProxyMapper::mapSelectionRightToLeft | ( | const QItemSelection & | selection | ) | const |
Maps the selection
from the right model to the left model.
Referenced by mapRightToLeft().
|
read |
Indicates whether there is a chain that can be followed from leftModel to rightModel.
This value can change if the sourceModel of an intermediate proxy is changed.