MAbstractItemModel implementation of a simple list data model.
More...
Inherits QAbstractItemModel.
List of all members.
Signals |
void | rowsInserted (const QModelIndex &parent, int first, int last, bool animated) |
void | rowsRemoved (const QModelIndex &parent, int first, int last, bool animated) |
void | layoutAboutToBeAnimated () |
Public Member Functions |
| MAbstractItemModel (QObject *parent=NULL) |
virtual | ~MAbstractItemModel () |
virtual int | groupCount () const =0 |
virtual int | rowCountInGroup (int group) const =0 |
virtual QString | groupTitle (int group) const =0 |
virtual QVariant | itemData (int row, int group, int role=Qt::DisplayRole) const =0 |
void | setGrouped (bool mode) |
bool | isGrouped () const |
Protected Member Functions |
void | beginInsertRows (const QModelIndex &parent, int first, int last, bool animated) |
void | beginRemoveRows (const QModelIndex &parent, int first, int last, bool animated) |
Properties |
bool | grouped |
Detailed Description
MAbstractItemModel implementation of a simple list data model.
Constructor & Destructor Documentation
MAbstractItemModel::MAbstractItemModel |
( |
QObject * |
parent = NULL |
) |
|
MAbstractItemModel::~MAbstractItemModel |
( |
|
) |
[virtual] |
Member Function Documentation
void MAbstractItemModel::beginInsertRows |
( |
const QModelIndex & |
parent, |
|
|
int |
first, |
|
|
int |
last, |
|
|
bool |
animated | |
|
) |
| | [protected] |
- Parameters:
-
| parent | The parent index where the row insertion begins. |
| first | The first row index. |
| last | The last row index. |
| animated | Flag to insert rows with or without animations. |
void MAbstractItemModel::beginRemoveRows |
( |
const QModelIndex & |
parent, |
|
|
int |
first, |
|
|
int |
last, |
|
|
bool |
animated | |
|
) |
| | [protected] |
- Parameters:
-
| parent | The parent index from which the rows are going to be removed. |
| first | The first row index. |
| last | The last row index. |
| animated | Flag to remove rows with or without animations. |
virtual int MAbstractItemModel::groupCount |
( |
|
) |
const [pure virtual] |
- Returns:
- Number of groups in the model. (O - for the plain list model).
virtual QString MAbstractItemModel::groupTitle |
( |
int |
group |
) |
const [pure virtual] |
- Parameters:
-
- Returns:
- Title of the group.
bool MAbstractItemModel::isGrouped |
( |
|
) |
const |
- Returns:
- The model grouping mode.
virtual QVariant MAbstractItemModel::itemData |
( |
int |
row, |
|
|
int |
group, |
|
|
int |
role = Qt::DisplayRole | |
|
) |
| | const [pure virtual] |
- Parameters:
-
| row | The row index in the group. |
| group | The group index in the model, (-1 - for the plain list model). |
| role | The item data role request. |
- Returns:
- The item data for the specified role.
void MAbstractItemModel::layoutAboutToBeAnimated |
( |
|
) |
[signal] |
- Parameters:
-
| The | signal is emitted if the layout change shall be animated. |
virtual int MAbstractItemModel::rowCountInGroup |
( |
int |
group |
) |
const [pure virtual] |
- Returns:
- Number of rows in the group.
void MAbstractItemModel::rowsInserted |
( |
const QModelIndex & |
parent, |
|
|
int |
first, |
|
|
int |
last, |
|
|
bool |
animated | |
|
) |
| | [signal] |
- Parameters:
-
| parent | Parent index in which the rows were inserted. |
| first | First inserted row index. |
| last | Last inserted row index. |
| animated | Flag that shows if the insert operation was with animations or not. |
void MAbstractItemModel::rowsRemoved |
( |
const QModelIndex & |
parent, |
|
|
int |
first, |
|
|
int |
last, |
|
|
bool |
animated | |
|
) |
| | [signal] |
- Parameters:
-
| parent | Parent index in which the rows were removed. |
| first | First removed row index. |
| last | Last removed row index. |
| animated | Flag that shows if the remove operation was with animations or not. |
void MAbstractItemModel::setGrouped |
( |
bool |
mode |
) |
|
Set's the grouping mode for the data model.
- Parameters:
-
| mode | The grouping mode of the model to set. |
Property Documentation
MAbstractItemModel::grouped [read, write] |
True if the model is a grouped (tree) model, false if the model is a plain list model.