Kross::ActionCollectionModel Class Reference
The ActionCollectionModel class implements a QAbstractItemModel to provide a model for views of a ActionCollection instance that manages a collection of Action instances.
More...
#include <model.h>
List of all members.
Public Types |
| enum | Mode { None = 0,
Icons = 1,
ToolTips = 2,
UserCheckable = 4
} |
Public Member Functions |
| | ActionCollectionModel (QObject *parent, ActionCollection *collection=0, Mode mode=Mode(Icons|ToolTips)) |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
| virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
| QModelIndex | indexForAction (Action *action) const |
| QModelIndex | indexForCollection (ActionCollection *collection) const |
| virtual bool | insertColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
| virtual bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| virtual QMimeData * | mimeData (const QModelIndexList &indexes) const |
| virtual QStringList | mimeTypes () const |
| virtual QModelIndex | parent (const QModelIndex &index) const |
| virtual bool | removeColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
| virtual bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| ActionCollection * | rootCollection () const |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| virtual Qt::DropActions | supportedDropActions () const |
| virtual | ~ActionCollectionModel () |
Static Public Member Functions |
| static Action * | action (const QModelIndex &index) |
| static ActionCollection * | collection (const QModelIndex &index) |
Protected Member Functions |
| int | rowNumber (ActionCollection *collection) const |
Detailed Description
The ActionCollectionModel class implements a QAbstractItemModel to provide a model for views of a ActionCollection instance that manages a collection of Action instances.
Important implementation detatils:
- An action can not have children.
- A collection can have both collections and actions as children.
- This model lists actions before collections.
- The internalPointer() of QModelIndex is used to hold a pointer to the parent collection.
Definition at line 46 of file model.h.
Member Enumeration Documentation
- Enumerator:
| None |
|
| Icons |
|
| ToolTips |
|
| UserCheckable |
|
Definition at line 50 of file model.h.
Constructor & Destructor Documentation
| ActionCollectionModel::~ActionCollectionModel |
( |
|
) |
[virtual] |
Member Function Documentation
| Action * ActionCollectionModel::action |
( |
const QModelIndex & |
index |
) |
[static] |
- Returns:
- the Action instance the as argument passed QModelIndex represents or NULL if the QModelIndex is not a Action .
Definition at line 187 of file model.cpp.
| ActionCollection * ActionCollectionModel::collection |
( |
const QModelIndex & |
index |
) |
[static] |
| int ActionCollectionModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() |
) |
const [virtual] |
| QVariant ActionCollectionModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole | |
|
) |
| | const [virtual] |
| bool ActionCollectionModel::dropMimeData |
( |
const QMimeData * |
data, |
|
|
Qt::DropAction |
action, |
|
|
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent | |
|
) |
| | [virtual] |
| Qt::ItemFlags ActionCollectionModel::flags |
( |
const QModelIndex & |
index |
) |
const [virtual] |
| QModelIndex ActionCollectionModel::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent = QModelIndex() | |
|
) |
| | const [virtual] |
| QModelIndex ActionCollectionModel::indexForAction |
( |
Action * |
action |
) |
const |
| QModelIndex ActionCollectionModel::indexForCollection |
( |
ActionCollection * |
collection |
) |
const |
| bool ActionCollectionModel::insertColumns |
( |
int |
column, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() | |
|
) |
| | [virtual] |
| bool ActionCollectionModel::insertRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() | |
|
) |
| | [virtual] |
| QMimeData * ActionCollectionModel::mimeData |
( |
const QModelIndexList & |
indexes |
) |
const [virtual] |
| QStringList ActionCollectionModel::mimeTypes |
( |
|
) |
const [virtual] |
| QModelIndex ActionCollectionModel::parent |
( |
const QModelIndex & |
index |
) |
const [virtual] |
| bool ActionCollectionModel::removeColumns |
( |
int |
column, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() | |
|
) |
| | [virtual] |
| bool ActionCollectionModel::removeRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() | |
|
) |
| | [virtual] |
Return the root collection.
Definition at line 79 of file model.cpp.
| int ActionCollectionModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() |
) |
const [virtual] |
| int ActionCollectionModel::rowNumber |
( |
ActionCollection * |
collection |
) |
const [protected] |
- Returns:
- the row number of the
collection
Definition at line 84 of file model.cpp.
| bool ActionCollectionModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole | |
|
) |
| | [virtual] |
| Qt::DropActions ActionCollectionModel::supportedDropActions |
( |
|
) |
const [virtual] |
The documentation for this class was generated from the following files: