This class is used to locate data in a CYIAbstractDataModel.
Indicies can be obtained through a variety of functions on CYIAbstractDataModel.
Each index refers to an item in a model. It has an associated row and column. It may have a parent, which provides a context for its row and column information.
An invalid index represents the root-level item of a CYIAbstractDataModel.
#include <datamodel/YiDataModelIndex.h>
Public Member Functions | |
| virtual | ~CYIDataModelIndex () |
| CYIDataModelIndex | GetChild (int32_t nRow, int32_t nColumn) const |
| CYIDataModelIndex | GetParent () const |
| int32_t | GetColumn () const |
| int32_t | GetRow () const |
| CYIAbstractDataModel * | GetModel () const |
| bool | IsValid () const |
| virtual CYIDataModelIndex & | operator= (const CYIDataModelIndex &other) |
| virtual bool | operator!= (const CYIDataModelIndex &other) const |
| virtual bool | operator== (const CYIDataModelIndex &other) const |
Protected Member Functions | |
| void | SetRow (int32_t nRow) |
| void | SetColumn (int32_t nColumn) |
| void | SetDataModel (CYIAbstractDataModel *pModel) |
| void | SetDataItem (CYIDataModelItem *pItem) |
Friends | |
| class | CYIAbstractDataModel |
| class | CYIAbstractDataModelPriv |
|
virtual |
| CYIDataModelIndex CYIDataModelIndex::GetChild | ( | int32_t | nRow, |
| int32_t | nColumn | ||
| ) | const |
Returns an index associated with the child item at coordinates specified by nRow and nColumn.
| int32_t CYIDataModelIndex::GetColumn | ( | ) | const |
Returns the column of the data model item this index is associated with.
-1 will be returned if this index is invalid.
| CYIAbstractDataModel* CYIDataModelIndex::GetModel | ( | ) | const |
Returns the data model that this index is associated with.
This function will return nullptr if this index is invalid.
| CYIDataModelIndex CYIDataModelIndex::GetParent | ( | ) | const |
Returns an index associated with the parent item.
| int32_t CYIDataModelIndex::GetRow | ( | ) | const |
Returns the row of the data model item this index is associated with.
-1 will be returned if this index is invalid.
| bool CYIDataModelIndex::IsValid | ( | ) | const |
Returns true if the row and column are both greater than 0, and if the associated data model is valid.
|
virtual |
|
virtual |
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
friend |
|
friend |