digiKam Developer Documentation: Digikam::GPSModelIndexProxyMapper Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Signals | Public Member Functions | Properties | List of all members
Digikam::GPSModelIndexProxyMapper Class Reference

This class facilitates easy mapping of indexes and selections through proxy models. More...

Inheritance diagram for Digikam::GPSModelIndexProxyMapper:

## 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
| Maps the `index` from the left model to the right model.
QModelIndex | mapRightToLeft (const QModelIndex &index) const
| Maps the `index` from the right model to the left model.
QItemSelection | mapSelectionLeftToRight (const QItemSelection &selection) const
| Maps the `selection` from the left model to the right model.
QItemSelection | mapSelectionRightToLeft (const QItemSelection &selection) const
| Maps the `selection` from the right model to the left model.

## Properties
bool | isConnected
| Indicates whether there is a chain that can be followed from leftModel to rightModel.

## Detailed Description

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.

## Property Documentation

## ◆ isConnected

bool Digikam::GPSModelIndexProxyMapper::isConnected
| read

This value can change if the sourceModel of an intermediate proxy is changed.