• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kross

Kross::ActionCollectionModel

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>

Inheritance diagram for Kross::ActionCollectionModel:
QAbstractItemModel

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

enum Kross::ActionCollectionModel::Mode
Enumerator:
None 
Icons 
ToolTips 
UserCheckable 

Definition at line 50 of file model.h.


Constructor & Destructor Documentation

ActionCollectionModel::ActionCollectionModel ( QObject *  parent,
ActionCollection *  collection = 0,
Mode  mode = Mode(Icons|ToolTips) 
) [explicit]

Definition at line 50 of file model.cpp.

ActionCollectionModel::~ActionCollectionModel (  )  [virtual]

Definition at line 74 of file model.cpp.


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]
Returns:
the ActionCollection instance the as argument passed QModelIndex represents or NULL if the QModelIndex is not a ActionCollection .

Definition at line 196 of file model.cpp.

int ActionCollectionModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const [virtual]

Definition at line 209 of file model.cpp.

QVariant ActionCollectionModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const [virtual]

Definition at line 267 of file model.cpp.

bool ActionCollectionModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
) [virtual]

Definition at line 439 of file model.cpp.

Qt::ItemFlags ActionCollectionModel::flags ( const QModelIndex &  index  )  const [virtual]

Definition at line 251 of file model.cpp.

QModelIndex ActionCollectionModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]

Definition at line 225 of file model.cpp.

QModelIndex ActionCollectionModel::indexForAction ( Action *  action  )  const

Definition at line 101 of file model.cpp.

QModelIndex ActionCollectionModel::indexForCollection ( ActionCollection *  collection  )  const

Definition at line 93 of file model.cpp.

bool ActionCollectionModel::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
) [virtual]

Definition at line 376 of file model.cpp.

bool ActionCollectionModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
) [virtual]

Definition at line 352 of file model.cpp.

QMimeData * ActionCollectionModel::mimeData ( const QModelIndexList &  indexes  )  const [virtual]

Definition at line 420 of file model.cpp.

QStringList ActionCollectionModel::mimeTypes (  )  const [virtual]

Definition at line 388 of file model.cpp.

QModelIndex ActionCollectionModel::parent ( const QModelIndex &  index  )  const [virtual]

Definition at line 238 of file model.cpp.

bool ActionCollectionModel::removeColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
) [virtual]

Definition at line 382 of file model.cpp.

bool ActionCollectionModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
) [virtual]

Definition at line 370 of file model.cpp.

ActionCollection * ActionCollectionModel::rootCollection (  )  const

Return the root collection.

Definition at line 79 of file model.cpp.

int ActionCollectionModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const [virtual]

Definition at line 214 of file model.cpp.

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]

Definition at line 324 of file model.cpp.

Qt::DropActions ActionCollectionModel::supportedDropActions (  )  const [virtual]

Definition at line 487 of file model.cpp.


The documentation for this class was generated from the following files:
  • model.h
  • model.cpp

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal