#include <view.h>
The ActionCollectionView class shows a QTreeView where the content of a ActionCollection is displayed and optional actions to run, stop, add, edit and remove scripts are provided.
Example how to create, fill and use an instance of a ActionCollectionView;
d.exec();
The ActionCollectionModel class implements a QAbstractItemModel to provide a model for views of a Act...
The ActionCollectionView class shows a QTreeView where the content of a ActionCollection is displayed...
virtual void setModel(QAbstractItemModel *model)
Set the model this view should use to model .
KActionCollection * actionCollection() const
static Manager & self()
Return the Manager instance.
Definition at line 163 of file view.h.
◆ ActionCollectionView()
ActionCollectionView::ActionCollectionView |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Constructor.
- Parameters
-
parent | The optional parent widget this widget is child of. |
Definition at line 284 of file view.cpp.
◆ ~ActionCollectionView()
ActionCollectionView::~ActionCollectionView |
( |
| ) |
|
|
virtual |
◆ actionCollection()
- Returns
- the KActionCollection which is filled with KAction instances this view provides. Per default there are the actions "run" to run a script, "stop" to stop execution, "edit" to edit the selected item, "add" to add a new item or resource, "remove" to remove the selected item and "manager" to call and show the modal Script Manager dialog.
Definition at line 369 of file view.cpp.
◆ button()
KPushButton * ActionCollectionView::button |
( |
const QString & |
actionname | ) |
const |
- Returns
- the KPushButton instance which has the actionname
actionname
or NULL if there is not such button.
Definition at line 374 of file view.cpp.
◆ createButton()
KPushButton * ActionCollectionView::createButton |
( |
QWidget * |
parentWidget, |
|
|
const QString & |
actionname |
|
) |
| |
Create and return a new KPushButton instance for the given actionname.
- Parameters
-
parentWidget | The parent widget. |
actionname | The name of the action. Each button points to an action from within the actionCollection() and triggers that action if the button got clicked. |
- Returns
- The new KPushButton instance or NULL if e.g. there exist no such action with
actionname
.
Definition at line 386 of file view.cpp.
◆ enabledChanged
void Kross::ActionCollectionView::enabledChanged |
( |
const QString & |
actionname | ) |
|
|
signal |
This signal is emitted if the enabled/disabled state of an action changed.
This happens for example if the slotSelectionChanged() above got called cause another item was selected.
- Parameters
-
actionname | The name of the action that changed. You are able to use actionCollection() to receive the to the name matching KAction instance. You are able to use e.g. a QSignalMapper here to map such changes direct to your e.g. KPushButton instances used to display some of the actions provided with actionCollection() . |
◆ isModified()
bool ActionCollectionView::isModified |
( |
| ) |
const |
- Returns
- true if the collection was modified.
Definition at line 359 of file view.cpp.
◆ itemSelection()
QItemSelection ActionCollectionView::itemSelection |
( |
| ) |
const |
|
protected |
This method provides us access to the QItemSelection.
Compared to the selectionModel()->selection() method this method does also map the selection to the source-model for the case e.g. the ActionCollectionProxyModel proxy-model was used rather then a ActionCollectionModel direct.
Definition at line 379 of file view.cpp.
◆ setModel()
◆ setModified()
void ActionCollectionView::setModified |
( |
bool |
modified | ) |
|
Set the internal modified state of the collection to modified
.
Definition at line 364 of file view.cpp.
◆ slotAdd
void ActionCollectionView::slotAdd |
( |
| ) |
|
|
virtualslot |
Called if the "add" action was triggered and a new item should be added.
Definition at line 521 of file view.cpp.
◆ slotDataChanged
void ActionCollectionView::slotDataChanged |
( |
const QModelIndex & |
topLeft, |
|
|
const QModelIndex & |
bottomRight |
|
) |
| |
|
protectedvirtualslot |
This slot got called if the data changed.
Definition at line 445 of file view.cpp.
◆ slotEdit
void ActionCollectionView::slotEdit |
( |
| ) |
|
|
virtualslot |
Called if the "edit" action was triggered and the select item should be edited via the scripts manager editor dialog.
Definition at line 487 of file view.cpp.
◆ slotEnabledChanged
void ActionCollectionView::slotEnabledChanged |
( |
const QString & |
actionname | ) |
|
|
protectedvirtualslot |
This slot got called if the enable/disable state of an action changed.
Definition at line 403 of file view.cpp.
◆ slotRemove
void ActionCollectionView::slotRemove |
( |
| ) |
|
|
virtualslot |
Called if the "remove" action was triggered and the selected item should be removed.
Definition at line 555 of file view.cpp.
◆ slotRun
void ActionCollectionView::slotRun |
( |
| ) |
|
|
virtualslot |
Called if the "run" action was triggered and the selected script should be executed.
Definition at line 450 of file view.cpp.
◆ slotSelectionChanged
void ActionCollectionView::slotSelectionChanged |
( |
| ) |
|
|
protectedvirtualslot |
This slot got called if the selected item changed.
Definition at line 411 of file view.cpp.
◆ slotStop
void ActionCollectionView::slotStop |
( |
| ) |
|
|
virtualslot |
Called if the "stop" action was triggered and the selected script stops execution if running.
Definition at line 471 of file view.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by
doxygen 1.9.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.