Home · All Classes · Main Classes · Deprecated |
Interface for creating and updating items (cells) for MList. More...
Inherited by MAbstractCellCreator< T >.
Public Member Functions | |
virtual | ~MCellCreator () |
virtual MWidget * | createCell (const QModelIndex &index, MWidgetRecycler &recycler) const =0 |
virtual void | updateCell (const QModelIndex &index, MWidget *cell) const =0 |
virtual QSizeF | cellSize () const =0 |
Interface for creating and updating items (cells) for MList.
MCellCreator is a purely abstract class and should be implemented by every class whose instances are intended to create items for MList.
Main purpose of this interface is to create and update data of widgets which has to be inserted into MList. Also MCellCreator returns size of a list item widget.
virtual MCellCreator::~MCellCreator | ( | ) | [inline, virtual] |
Default virtual destructor.
virtual QSizeF MCellCreator::cellSize | ( | ) | const [pure virtual] |
This function should return cell size. Minimum and maximum sizes of cell widget will be updated if returned size bigger then maximum size or smaller then minimum size. Only height will be taken into account, width of item will be calculate by MList.
Implemented in MAbstractCellCreator< T >.
virtual MWidget* MCellCreator::createCell | ( | const QModelIndex & | index, | |
MWidgetRecycler & | recycler | |||
) | const [pure virtual] |
When MList needs a cell, it will call this function to get a pointer to a widget. MList keeps ownership of a pointer and will delete object when it's not needed. It's not required but highly recommended to use recycler. This function will be called very often during panning and to make panning smooth creator shouldn't allocate memory.
Function should return fully constructed and initialized object. All data has to be set.
index | is a model index of the row for which widget should be created | |
recycler | is a MWidgetRecycler which allows widget reusage. MList will put widgets to this recycler and its possible to get recycled widget from it | |
pointer | to fully created widget |
Implemented in MAbstractCellCreator< T >.
virtual void MCellCreator::updateCell | ( | const QModelIndex & | index, | |
MWidget * | cell | |||
) | const [pure virtual] |
This function should be implemented in order to update content of existing list item.
index | model index which data should be set | |
cell | widget where data should be updated |
Copyright © 2010 Nokia Corporation | MeeGo Touch |