Messagelib

modelinvariantindex.cpp
1 /******************************************************************************
2  *
3  * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <[email protected]>
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  *
7  *******************************************************************************/
8 
9 #include "core/modelinvariantindex.h"
10 #include "core/modelinvariantindex_p.h"
11 #include "core/modelinvariantrowmapper.h"
12 #include "core/modelinvariantrowmapper_p.h"
13 
14 using namespace MessageList::Core;
15 
16 ModelInvariantIndex::ModelInvariantIndex()
17  : d(new ModelInvariantIndexPrivate)
18 {
19 }
20 
21 ModelInvariantIndex::~ModelInvariantIndex()
22 {
23  if (d->mRowMapper) {
24  d->mRowMapper->d->indexDead(this);
25  }
26 }
27 
29 {
30  return d->mRowMapper != nullptr;
31 }
32 
34 {
35  if (d->mRowMapper) {
36  return d->mRowMapper->modelInvariantIndexToModelIndexRow(this);
37  }
38  return -1;
39 }
bool isValid() const
Returns true if this ModelInvariantIndex is valid, that is, it has been attached to a ModelInvariantR...
int currentModelIndexRow()
Returns the current model index row for this invariant index.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 21 2022 03:53:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.