KDE 4.6 PyKDE API Reference

- KDE's Python API

# KDataToolAction Class Reference

`from PyKDE4.kio import *`

Inherits: KAction → QWidgetAction → QAction → QObject

## Detailed Description

This class helps applications implement support for KDataTool. The steps to follow are simple:

- query for the available tools using KDataToolInfo.query
- pass the result to KDataToolAction.dataToolActionList (with a slot)
- plug the resulting actions, either using KXMLGUIClient.plugActionList, or by hand.

The slot defined for step 2 is called when the action is activated, and that's where the tool should be created and run.

## Signals

| toolActivated (KDataToolInfo info, QString command)

## Methods

| __init__ (self, QString text, KDataToolInfo info, QString command, QObject parent)
| slotActivated (self)

## Static Methods

[QAction] | dataToolActionList ([KDataToolInfo] tools, QObject receiver, QString slot, KActionCollection parent)

## Signal Documentation

toolActivated | ( | KDataToolInfo | info,
|  | QString | command
| ) |  |  |

Emitted when a tool has been activated.

Parameters:

  | info | a description of the activated tools
  | command | the command for the tool

Signal syntax:
  `QObject.connect(source, SIGNAL("toolActivated(const KDataToolInfo&, const QString&)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QString | text,
|  | KDataToolInfo | info,
|  | QString | command,
|  | QObject | parent
| ) |  |  |

Constructs a new KDataToolAction.

Parameters:

  | text | The text that will be displayed
  | info | The corresponding KDataToolInfo
  | command | The command of the action
  | parent | This action's parent
  | name | The name of the action

slotActivated | ( |  | self ) |

## Static Method Documentation

[QAction] dataToolActionList | ( | [KDataToolInfo] | tools,
|  | QObject | receiver,
|  | QString | slot,
|  | KActionCollection | parent
| ) |  |  |

Creates a list of actions from a list of information about data-tools. The slot must have a signature corresponding to the toolActivated signal.

Note that it's the caller's responsibility to delete the actions when they're not needed anymore.

Parameters:

  | tools | the list of data tool descriptions
  | receiver | the receiver for toolActivated() signals
  | slot | the slot that will receive the toolActivated() signals
  | parent | the parent action collection for the actions to be created

Returns:
  the KActions