digiKam
Digikam::GPSModelIndexProxyMapper Class Reference
+ 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
 
QModelIndex mapRightToLeft (const QModelIndex &index) const
 
QItemSelection mapSelectionLeftToRight (const QItemSelection &selection) const
 
QItemSelection mapSelectionRightToLeft (const QItemSelection &selection) const
 
 ~GPSModelIndexProxyMapper () override
 

Properties

bool isConnected
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GPSModelIndexProxyMapper()

Digikam::GPSModelIndexProxyMapper::GPSModelIndexProxyMapper ( const QAbstractItemModel *const  leftModel,
const QAbstractItemModel *const  rightModel,
QObject *const  parent = nullptr 
)
explicit

◆ ~GPSModelIndexProxyMapper()

Digikam::GPSModelIndexProxyMapper::~GPSModelIndexProxyMapper ( )
override

Member Function Documentation

◆ isConnected()

bool Digikam::GPSModelIndexProxyMapper::isConnected ( ) const

◆ isConnectedChanged

void Digikam::GPSModelIndexProxyMapper::isConnectedChanged ( )
signal

◆ mapLeftToRight()

QModelIndex Digikam::GPSModelIndexProxyMapper::mapLeftToRight ( const QModelIndex &  index) const

Maps the index from the left model to the right model.

References mapSelectionLeftToRight().

◆ mapRightToLeft()

QModelIndex Digikam::GPSModelIndexProxyMapper::mapRightToLeft ( const QModelIndex &  index) const

Maps the index from the right model to the left model.

References mapSelectionRightToLeft().

◆ mapSelectionLeftToRight()

QItemSelection Digikam::GPSModelIndexProxyMapper::mapSelectionLeftToRight ( const QItemSelection &  selection) const

Maps the selection from the left model to the right model.

Referenced by mapLeftToRight().

◆ mapSelectionRightToLeft()

QItemSelection Digikam::GPSModelIndexProxyMapper::mapSelectionRightToLeft ( const QItemSelection &  selection) const

Maps the selection from the right model to the left model.

Referenced by mapRightToLeft().

Property Documentation

◆ isConnected

bool Digikam::GPSModelIndexProxyMapper::isConnected
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.


The documentation for this class was generated from the following files: