MessageList::Core::ModelInvariantIndex

MessageList::Core::ModelInvariantIndex Class Reference

#include <modelinvariantindex.h>

Inheritance diagram for MessageList::Core::ModelInvariantIndex:

Public Member Functions

int currentModelIndexRow ()
 
bool isValid () const
 

Detailed Description

An invariant index that can be ALWAYS used to reference an item inside a QAbstractItemModel.

This class is meant to be used together with ModelInvariantRowMapper.

Definition at line 26 of file modelinvariantindex.h.

Member Function Documentation

int ModelInvariantIndex::currentModelIndexRow ( )

Returns the current model index row for this invariant index.

This function calls the mapper and asks it to perform the persistent mapping. If this index isn't valid then the returned value is -1.

If you actually own the row mapper then you may save some clock cycles by calling the modelInvariantIndexToModelIndexRow() by your own. If you don't own the mapper then this function is the only way to go.

Definition at line 36 of file modelinvariantindex.cpp.

bool ModelInvariantIndex::isValid ( ) const

Returns true if this ModelInvariantIndex is valid, that is, it has been attached to a ModelInvariantRowMapper.

Returns false otherwise. An invalid index will always map to the current row -1 (which is invalid as QModelIndex row).

Definition at line 31 of file modelinvariantindex.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 10 2020 23:11:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.