class KAction


Definition#include <kaction.h>
InheritsQObject
Annotated List
Files
Globals
Hierarchy
Index
Main

Public Methods

Public Slots

Signals

Public Static Methods


Detailed Description

KTabButton is a helper class for KTabBar. It provides the buttons used to scroll the tab bar.

 KAction ( const QString& text, int accel = 0, QObject* parent = 0, const char* name = 0 )

Construct an action with text and potential keyboard accelerator but nothing else. Use this only if you really know what you are doing.

Parameters:
textThe text that will be displayed.
accelThe corresponding keyboard accelerator (shortcut).
parentThis action's parent.
nameAn internal name for this action.

 KAction ( const QString& text, int accel, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 )

Construct an action with text, potential keyboard accelerator, and a SLOT to call when this action is invoked by the user.

If you do not want or have a keyboard accelerator, set the accel param to 0.

This is the most common KAction used when you do not have a corresponding icon.

Parameters:
textThe text that will be displayed.
accelThe corresponding keyboard accelerator (shortcut).
receiverThe SLOT's parent.
slotThe SLOT to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

 KAction ( const QString& text, const QIconSet& pix, int accel = 0, QObject* parent = 0, const char* name = 0 )

Construct an action with text, icon, and a potential keyboard accelerator.

This Action cannot execute any command. Use this only if you really know what you are doing.

Parameters:
textThe text that will be displayed.
pixThe icons that go with this action.
accelThe corresponding keyboard accelerator (shortcut).
parentThis action's parent.
nameAn internal name for this action.

 KAction ( const QString& text, const QString& pix, int accel = 0, QObject* parent = 0, const char* name = 0 )

Construct an action with text, automatically loaded icon, and a potential keyboard accelerator.

This Action cannot execute any command. Use this only if you really know what you are doing.

Parameters:
textThe text that will be displayed.
pixThe icons that go with this action.
accelThe corresponding keyboard accelerator (shortcut).
parentThis action's parent.
nameAn internal name for this action.

 KAction ( const QString& text, const QIconSet& pix, int accel, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 )

Construct an action with text, icon, potential keyboard accelerator, and a SLOT to call when this action is invoked by the user.

If you do not want or have a keyboard accelerator, set the accel param to 0.

This is the other common KAction used. Use it when you do have a corresponding icon.

Parameters:
textThe text that will be displayed.
pixThe icon to display.
accelThe corresponding keyboard accelerator (shortcut).
receiverThe SLOT's parent.
slotThe SLOT to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

 KAction ( const QString& text, const QString& pix, int accel, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 )

Construct an action with text, icon, potential keyboard accelerator, and a SLOT to call when this action is invoked by the user. The icon is loaded on demand later based on where it is plugged in.

If you do not want or have a keyboard accelerator, set the accel param to 0.

This is the other common KAction used. Use it when you do have a corresponding icon.

Parameters:
textThe text that will be displayed.
pixThe icon to display.
accelThe corresponding keyboard accelerator (shortcut).
receiverThe SLOT's parent.
slotThe SLOT to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

 KAction ( QObject* parent = 0, const char* name = 0 )

Construct a null action.

Parameters:
parentThis action's parent.
nameAn internal name for this action.

KAction ()

[virtual]

Standard destructor

int  plug ( QWidget *w, int index = -1 )

[virtual]

"Plug" or insert this action into a given widget.

This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your KAction object.

Parameters:
wThe GUI element to display this action

void  plugAccel (KAccel *accel, bool configurable = true)

[virtual]

"Plug" or insert this action into a given KAccel.

It is sometimes useful to use the action paradigm for actions that are not associated with some widget (ie actions that are only activated by keyboard).

Parameters:
accelThe KAccel which activates this action
configurableIf the accelerator is configurable via the KAccel configuration dialog (this is somehow deprecated since there is now a KAction key configuration dialog).

void  unplug ( QWidget *w )

[virtual]

"Unplug" or remove this action from a given widget.

This will typically be a menu or a toolbar. This is rarely used in "normal" application. Typically, it would be used if your application has several views or modes, each with a completely different menu structure. If you simply want to disable an action for a given period, use setEnabled() instead.

Parameters:
wRemove the action from this GUI element.

void  unplugAccel ()

[virtual]

Disconnect this action from the KAccel.

bool  isPlugged ()

[const virtual]

returns whether the action is plugged into any container widget or not.

bool  isPlugged ( const QWidget *container, int id )

[const virtual]

returns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) .

bool  isPlugged ( const QWidget *container, const QWidget *_representative )

[const virtual]

returns whether the action is plugged into the given container with the given, container specific, representative container widget item.

QWidget*  container ( int index )

[const]

int  itemId ( int index )

[const]

QWidget*  representative ( int index )

[const]

int  containerCount ()

[const]

QPixmap  pixmap ()

[const virtual]

bool  hasIconSet ()

[const virtual]

QString  plainText ()

[const virtual]

QString  text ()

[const virtual]

Get the text associated with this action.

int  accel ()

[const virtual]

Get the keyboard accelerator associated with this action.

bool  isEnabled ()

[const virtual]

Returns true if this action is enabled.

QString  group ()

[const virtual]

QString  whatsThis ()

[const virtual]

Get the What's this text for the action.

QString  toolTip ()

[const virtual]

Get the tooltip text for the action.

QString  statusText ()

[const virtual]

QIconSet  iconSet ()

[const virtual]

Get the QIconSet from which the icons used to display this action will be chosen.

QString  icon ()

[const virtual]

KActionCollection * parentCollection ()

[const]

int  getToolButtonID ()

[static]

Generate a toolbar button id. Made public for reimplementations.

void  unplugAll ()

void  setText (const QString &text)

[virtual slot]

Set the text associated with this action. The text is used for menu and toolbar labels etc.

void  setAccel (int a)

[virtual slot]

Set the keyboard accelerator associated with this action.

void  setGroup ( const QString& )

[virtual slot]

void  setWhatsThis ( const QString& text )

[virtual slot]

Set the What's this text for the action. This text will be displayed when a widget that has been created by plugging this action into a container is clicked on in What's this mode.

The What's this text can of course include QML markup as well as raw text.

void  setToolTip ( const QString& )

[virtual slot]

Set the tooltip text for the action.

void  setIconSet ( const QIconSet &iconSet )

[virtual slot]

Set the QIconSet from which the icons used to display this action will be chosen.

void  setIcon ( const QString& icon )

[virtual slot]

void  setStatusText ( const QString &text )

[virtual slot]

void  setEnabled (bool enable)

[virtual slot]

Enables or disables this action. All uses of this action (eg. in menus or toolbars) will be updated to reflect the state of the action.

void  activate ()

[virtual slot]

Emulate user's interaction programmatically, by activating the action. The implementation simply emits activated().

protected slots: void  slotDestroyed ()

[virtual slot]

void  slotKeycodeChanged ()

[virtual slot]

void  slotActivated ()

[virtual slot]

protected: KToolBar*  toolBar ( int index )

[const slot]

QPopupMenu*  popupMenu ( int index )

[const slot]

void  removeContainer ( int index )

[slot]

int  findContainer ( const QWidget* widget )

[const slot]

void  addContainer ( QWidget* parent, int id )

[slot]

void  addContainer ( QWidget* parent, QWidget* representative )

[slot]

void  setAccel ( int id, int accel )

[virtual slot]

void  setGroup ( int id, const QString& grp )

[virtual slot]

void  setText (int i, const QString &text)

[virtual slot]

void  setEnabled (int i, bool enable)

[virtual slot]

void  setIconSet (int i, const QIconSet &iconSet)

[virtual slot]

void  setIcon ( int i, const QString& icon )

[virtual slot]

void  setToolTip ( int id, const QString& tt )

[virtual slot]

void  setStatusText ( int id, const QString &text )

[virtual slot]

void  setWhatsThis ( int id, const QString& text )

[virtual slot]

int  menuId ( int i )

[slot]

for backwards compatibility. depreceated!

void  activated ()

[signal]

void  enabled ( bool )

[signal]