liblancelot
#include <MergedActionListModel.h>
Public Member Functions | |
MergedActionListModel () | |
virtual | ~MergedActionListModel () |
void | addModel (QIcon icon, const QString &title, ActionListModel *model) |
void | addModel (ActionListModel *model) |
L_Override void | contextActivate (int index, QAction *context) |
L_Override void | dataDragFinished (int index, Qt::DropAction action) |
L_Override bool | dataDropAvailable (int where, const QMimeData *mimeData) |
L_Override void | dataDropped (int where, const QMimeData *mimeData) |
L_Override QString | description (int index) const |
L_Override bool | hasContextActions (int index) const |
virtual bool | hasModelContextActions (int index) const |
bool | hideEmptyModels () const |
L_Override QIcon | icon (int index) const |
L_Override bool | isCategory (int index) const |
L_Override QMimeData * | mimeData (int index) const |
ActionListModel * | modelAt (int index) |
virtual void | modelContextActivate (int index, QAction *context) |
int | modelCount () const |
virtual void | modelDataDropped (int index, Qt::DropAction action) |
virtual QMimeData * | modelMimeData (int index) const |
void | removeModel (int index) |
L_Override void | setContextActions (int index, Lancelot::PopupMenu *menu) |
L_Override void | setDropActions (int index, Qt::DropActions &actions, Qt::DropAction &defaultAction) |
void | setHideEmptyModels (bool hide) |
virtual void | setModelContextActions (int index, Lancelot::PopupMenu *menu) |
virtual void | setModelDropActions (int index, Qt::DropActions &actions, Qt::DropAction &defaultAction) |
void | setShowModelTitles (bool show) |
bool | showModelTitles () const |
L_Override int | size () const |
L_Override QString | title (int index) const |
Public Member Functions inherited from Lancelot::ActionListModel | |
ActionListModel () | |
virtual | ~ActionListModel () |
virtual QIcon | selfIcon () const |
virtual QMimeData * | selfMimeData () const |
virtual QString | selfShortTitle () const |
virtual QString | selfTitle () const |
Protected Slots | |
void | modelItemAltered (int index) |
void | modelItemDeleted (int index) |
void | modelItemInserted (int index) |
void | modelUpdated () |
Protected Member Functions | |
L_Override void | activate (int index) |
Additional Inherited Members | |
Public Slots inherited from Lancelot::ActionListModel | |
void | activated (int index) |
Signals inherited from Lancelot::ActionListModel | |
void | itemActivated (int index) |
void | itemAltered (int index) |
void | itemDeleted (int index) |
void | itemInserted (int index) |
void | updated () |
Detailed Description
This class implements a model that merges a list of other models.
Titles in the sub-models are represented as categories in the merged one.
Definition at line 36 of file MergedActionListModel.h.
Constructor & Destructor Documentation
Lancelot::MergedActionListModel::MergedActionListModel | ( | ) |
Creates a new instance of MergedActionListModel.
Definition at line 36 of file MergedActionListModel.cpp.
|
virtual |
Destroys this MergedActionListModel.
Definition at line 43 of file MergedActionListModel.cpp.
Member Function Documentation
|
protectedvirtual |
Models should reimplement this function.
It is invoked when an item is activated, before the itemActivated signal is emitted
- Parameters
-
index of the item that is activated
Reimplemented from Lancelot::ActionListModel.
Definition at line 222 of file MergedActionListModel.cpp.
void Lancelot::MergedActionListModel::addModel | ( | QIcon | icon, |
const QString & | title, | ||
ActionListModel * | model | ||
) |
Adds a model to the list.
- Parameters
-
icon icon for the model title title of the model model model to add
Definition at line 322 of file MergedActionListModel.cpp.
void Lancelot::MergedActionListModel::addModel | ( | ActionListModel * | model | ) |
Adds a model to the list.
Title and icon is loaded from model
- Parameters
-
model model to add
Definition at line 317 of file MergedActionListModel.cpp.
|
virtual |
Method for handling context menu actions.
- Parameters
-
index of the activated item context index of the context action
Reimplemented from Lancelot::ActionListModel.
Definition at line 262 of file MergedActionListModel.cpp.
|
virtual |
This function is invoked when a data is dropped.
- Parameters
-
index index of the dragged item action invoked drop action
Reimplemented from Lancelot::ActionListModel.
Definition at line 131 of file MergedActionListModel.cpp.
|
virtual |
- Returns
- whether the data can be dropped at the specified position
- Parameters
-
where position mimeData dragged data
Reimplemented from Lancelot::ActionListModel.
Definition at line 172 of file MergedActionListModel.cpp.
|
virtual |
Invoked when the data is dropped into the model.
- Parameters
-
where position mimeData dropped data
Reimplemented from Lancelot::ActionListModel.
Definition at line 182 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item
- Returns
- description of the specified item
Reimplemented from Lancelot::ActionListModel.
Definition at line 101 of file MergedActionListModel.cpp.
|
virtual |
- Returns
- whether the specified item has context actions
- Parameters
-
index index of the item
Reimplemented from Lancelot::ActionListModel.
Definition at line 242 of file MergedActionListModel.cpp.
|
virtual |
- Returns
- whether the model has context actions
- Parameters
-
index model for which context menu is tested Reimplement this function if you want to support context menus for models when user right clicks the captio item
Definition at line 192 of file MergedActionListModel.cpp.
bool Lancelot::MergedActionListModel::hideEmptyModels | ( | ) | const |
- Returns
- whether the empty models are hidden
Definition at line 371 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item
- Returns
- icon for the specified item
Reimplemented from Lancelot::ActionListModel.
Definition at line 111 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item
- Returns
- whether the item represents a category
Reimplemented from Lancelot::ActionListModel.
Definition at line 212 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item
- Returns
- mime data for the specified item
Reimplemented from Lancelot::ActionListModel.
Definition at line 121 of file MergedActionListModel.cpp.
ActionListModel * Lancelot::MergedActionListModel::modelAt | ( | int | index | ) |
- Returns
- model with the specified index
- Parameters
-
index index of the model to return
Definition at line 338 of file MergedActionListModel.cpp.
|
virtual |
Activates the context for the specified model.
- Parameters
-
index model index activated action Reimplement this function if you want to support context menus for models when user right clicks the captio item
Definition at line 205 of file MergedActionListModel.cpp.
int Lancelot::MergedActionListModel::modelCount | ( | ) | const |
- Returns
- number of the models
Definition at line 355 of file MergedActionListModel.cpp.
|
virtual |
This function is invoked when a model is dragged and dropped.
Reimplement this function if you want to support dragging the models inside the MergedActionListModel by dragging their caption items.
Definition at line 142 of file MergedActionListModel.cpp.
|
protectedslot |
Definition at line 89 of file MergedActionListModel.cpp.
|
protectedslot |
Definition at line 71 of file MergedActionListModel.cpp.
|
protectedslot |
Definition at line 53 of file MergedActionListModel.cpp.
|
virtual |
- Returns
- mime data for the specified model Reimplement this function if you want to support dragging the models inside the MergedActionListModel by dragging their caption items.
Definition at line 166 of file MergedActionListModel.cpp.
|
protectedslot |
Definition at line 48 of file MergedActionListModel.cpp.
void Lancelot::MergedActionListModel::removeModel | ( | int | index | ) |
Removes a model from the list.
- Parameters
-
index index of the model to remove
Definition at line 343 of file MergedActionListModel.cpp.
|
virtual |
Adds actions ofr the specifies item to menu.
- Parameters
-
index index of the item menu menu to add the actions to
Reimplemented from Lancelot::ActionListModel.
Definition at line 252 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item to be dragged actions supported drop actions defaultAction default drop action
Reimplemented from Lancelot::ActionListModel.
Definition at line 148 of file MergedActionListModel.cpp.
void Lancelot::MergedActionListModel::setHideEmptyModels | ( | bool | hide | ) |
Sets whether the empty models should be hidden.
Definition at line 376 of file MergedActionListModel.cpp.
|
virtual |
Sets the actions for the context menu.
- Parameters
-
index model for which context menu should be set Reimplement this function if you want to support context menus for models when user right clicks the captio item
Definition at line 198 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the model to be dragged actions supported drop actions defaultAction default drop action Reimplement this function if you want to support dragging the models inside the MergedActionListModel by dragging their caption items.
Definition at line 158 of file MergedActionListModel.cpp.
void Lancelot::MergedActionListModel::setShowModelTitles | ( | bool | show | ) |
Sets whether model titles are shown.
Definition at line 388 of file MergedActionListModel.cpp.
bool Lancelot::MergedActionListModel::showModelTitles | ( | ) | const |
- Returns
- whether the model titles are shown
Definition at line 383 of file MergedActionListModel.cpp.
|
virtual |
- Returns
- the number of items in model
Implements Lancelot::ActionListModel.
Definition at line 361 of file MergedActionListModel.cpp.
|
virtual |
- Parameters
-
index index of the item
- Returns
- title for the specified item
Implements Lancelot::ActionListModel.
Definition at line 232 of file MergedActionListModel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon Oct 13 2014 22:55:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.