|
OpenMW
|
A proxy item model can be used to filter or rearrange items from a source model (or even add new items to it). The neat thing is that this does not actually alter the source model. More...
#include <itemmodel.hpp>
Public Member Functions | |
| ProxyItemModel () | |
| virtual | ~ProxyItemModel () |
| virtual MWWorld::Ptr | copyItem (const ItemStack &item, size_t count, bool setNewOwner=false) |
| virtual void | removeItem (const ItemStack &item, size_t count) |
| virtual ModelIndex | getIndex (ItemStack item) |
| Returns an invalid index if the item was not found. More... | |
| void | setSourceModel (ItemModel *sourceModel) |
| ModelIndex | mapToSource (ModelIndex index) |
| ModelIndex | mapFromSource (ModelIndex index) |
Public Member Functions inherited from MWGui::ItemModel | |
| ItemModel () | |
| virtual | ~ItemModel () |
| virtual ItemStack | getItem (ModelIndex index)=0 |
| Throws for invalid index or out of range index. More... | |
| virtual size_t | getItemCount ()=0 |
| virtual void | update ()=0 |
| Rebuild the item model, this will invalidate existing model indices. More... | |
| virtual MWWorld::Ptr | moveItem (const ItemStack &item, size_t count, ItemModel *otherModel) |
| virtual bool | allowedToInsertItems () const |
| Is the player allowed to insert items into this model? (default true) More... | |
Protected Attributes | |
| ItemModel * | mSourceModel |
Additional Inherited Members | |
Public Types inherited from MWGui::ItemModel | |
| typedef int | ModelIndex |
A proxy item model can be used to filter or rearrange items from a source model (or even add new items to it). The neat thing is that this does not actually alter the source model.
| MWGui::ProxyItemModel::ProxyItemModel | ( | ) |
|
virtual |
|
virtual |
| setNewOwner | If true, set the copied item's owner to the actor we are copying to, otherwise reset owner to "" |
Implements MWGui::ItemModel.
|
virtual |
Returns an invalid index if the item was not found.
Implements MWGui::ItemModel.
| ItemModel::ModelIndex MWGui::ProxyItemModel::mapFromSource | ( | ModelIndex | index | ) |
| ItemModel::ModelIndex MWGui::ProxyItemModel::mapToSource | ( | ModelIndex | index | ) |
|
virtual |
Implements MWGui::ItemModel.
Reimplemented in MWGui::PickpocketItemModel.
| void MWGui::ProxyItemModel::setSourceModel | ( | ItemModel * | sourceModel | ) |
|
protected |
1.8.6