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

Kross

  • Kross
  • ActionCollectionView
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Kross::ActionCollectionView Class Reference

#include <view.h>

Inheritance diagram for Kross::ActionCollectionView:
Inheritance graph
[legend]

Public Slots

virtual void slotAdd ()
 
virtual void slotEdit ()
 
virtual void slotRemove ()
 
virtual void slotRun ()
 
virtual void slotStop ()
 

Signals

void enabledChanged (const QString &actionname)
 

Public Member Functions

 ActionCollectionView (QWidget *parent=0)
 
virtual ~ActionCollectionView ()
 
KActionCollection * actionCollection () const
 
KPushButton * button (const QString &actionname) const
 
KPushButton * createButton (QWidget *parentWidget, const QString &actionname)
 
bool isModified () const
 
virtual void setModel (QAbstractItemModel *model)
 
void setModified (bool modified)
 

Protected Slots

virtual void slotDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
virtual void slotEnabledChanged (const QString &actionname)
 
virtual void slotSelectionChanged ()
 

Protected Member Functions

QItemSelection itemSelection () const
 

Detailed Description

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;

// We like to show the widget in a dialog.
KDialog d(this);
// Create the view.
ActionCollectionView* v = new ActionCollectionView( d.mainWidget() );
// Create the model.
ActionCollectionModel::Mode mode( ActionCollectionModel::Icons | ActionCollectionModel::ToolTips | ActionCollectionModel::UserCheckable );
ActionCollectionModel* m = new ActionCollectionModel(view, Manager::self().actionCollection(), mode);
// Set the model the view should use.
v->setModel(m);
// Show the dialog.
d.exec();

Definition at line 163 of file view.h.

Constructor & Destructor Documentation

ActionCollectionView::ActionCollectionView ( QWidget *  parent = 0)
explicit

Constructor.

Parameters
parentThe optional parent widget this widget is child of.

Definition at line 284 of file view.cpp.

ActionCollectionView::~ActionCollectionView ( )
virtual

Destructor.

Definition at line 340 of file view.cpp.

Member Function Documentation

KActionCollection * ActionCollectionView::actionCollection ( ) const
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.

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.

KPushButton * ActionCollectionView::createButton ( QWidget *  parentWidget,
const QString &  actionname 
)

Create and return a new KPushButton instance for the given actionname.

Parameters
parentWidgetThe parent widget.
actionnameThe 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.

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
actionnameThe 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() .
bool ActionCollectionView::isModified ( ) const
Returns
true if the collection was modified.

Definition at line 359 of file view.cpp.

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.

void ActionCollectionView::setModel ( QAbstractItemModel *  model)
virtual

Set the model this view should use to model .

Use an instance of ActionCollectionModel or ActionCollectionProxyModel as model.

Definition at line 345 of file view.cpp.

void ActionCollectionView::setModified ( bool  modified)

Set the internal modified state of the collection to modified .

Definition at line 364 of file view.cpp.

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.

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.

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.

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.

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.

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.

void ActionCollectionView::slotSelectionChanged ( )
protectedvirtualslot

This slot got called if the selected item changed.

Definition at line 411 of file view.cpp.

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:
  • view.h
  • view.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal