• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
TDEAction Class Reference

#include <tdeaction.h>

Inheritance diagram for TDEAction:
KWidgetAction TDEActionMenu TDEPasteTextAction TDESelectAction TDEToggleAction TDEToolBarPopupAction TDEToolBarLabelAction TDEListAction TDERadioAction TDEToggleFullScreenAction TDEToggleToolBarAction TDERecentFilesAction

Public Types

enum  ActivationReason {
  UnknownActivation , EmulatedActivation , AccelActivation , PopupMenuActivation ,
  ToolBarActivation
}
 

Public Slots

virtual void setText (const TQString &text)
 
virtual bool setShortcut (const TDEShortcut &)
 
virtual void setGroup (const TQString &)
 
virtual void setWhatsThis (const TQString &text)
 
virtual void setToolTip (const TQString &)
 
virtual void setIconSet (const TQIconSet &iconSet)
 
virtual void setIcon (const TQString &icon)
 
virtual void setEnabled (bool enable)
 
void setDisabled (bool disable)
 
virtual void setShortcutConfigurable (bool)
 
virtual void activate ()
 

Signals

void activated ()
 
void activated (TDEAction::ActivationReason reason, TQt::ButtonState state)
 
void enabled (bool)
 

Public Member Functions

 TDEAction (const TQString &text, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
 
 TDEAction (const TQString &text, const TQIconSet &pix, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
 
 TDEAction (const TQString &text, const TQString &pix, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
 
 TDEAction (const KGuiItem &item, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
 
 TDEAction (const TQString &text, const TDEShortcut &cut=TDEShortcut(), TQObject *parent=0, const char *name=0)
 
 TDEAction (const TQString &text, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name=0)
 
 TDEAction (const TQString &text, const TQIconSet &pix, const TDEShortcut &cut=TDEShortcut(), TQObject *parent=0, const char *name=0)
 
 TDEAction (const TQString &text, const TQString &pix, const TDEShortcut &cut=TDEShortcut(), TQObject *parent=0, const char *name=0)
 
 TDEAction (const TQString &text, const TQIconSet &pix, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name=0)
 
 TDEAction (const TQString &text, const TQString &pix, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name=0)
 
 TDEAction (TQObject *parent=0, const char *name=0)
 
virtual ~TDEAction ()
 
virtual int plug (TQWidget *widget, int index=-1)
 
virtual void plugAccel (TDEAccel *accel, bool configurable=true) TDE_DEPRECATED
 
virtual void unplug (TQWidget *w)
 
virtual void unplugAccel () TDE_DEPRECATED
 
virtual bool isPlugged () const
 
bool isPlugged (const TQWidget *container) const
 
virtual bool isPlugged (const TQWidget *container, int id) const
 
virtual bool isPlugged (const TQWidget *container, const TQWidget *_representative) const
 
TQWidget * container (int index) const
 
int itemId (int index) const
 
TQWidget * representative (int index) const
 
int containerCount () const
 
uint tdeaccelCount () const
 
virtual bool hasIcon () const
 
bool hasIconSet () const
 
virtual TQString plainText () const
 
virtual TQString text () const
 
virtual const TDEShortcut & shortcut () const
 
virtual const TDEShortcut & shortcutDefault () const
 
TQString shortcutText () const
 
void setShortcutText (const TQString &)
 
virtual bool isEnabled () const
 
virtual bool isShortcutConfigurable () const
 
virtual TQString group () const
 
virtual TQString whatsThis () const
 
virtual TQString toolTip () const
 
virtual TQIconSet iconSet (TDEIcon::Group group, int size=0) const
 
TQIconSet iconSet () const
 
virtual TQString icon () const
 
TDEActionCollection * parentCollection () const
 
void unplugAll ()
 
int accel () const TDE_DEPRECATED
 
TQString statusText () const
 
void setAccel (int key) TDE_DEPRECATED
 
void setStatusText (const TQString &text)
 
int menuId (int i)
 

Static Public Member Functions

static int getToolButtonID ()
 

Protected Slots

virtual void slotDestroyed ()
 
virtual void slotKeycodeChanged ()
 
virtual void slotActivated ()
 
void slotPopupActivated ()
 
void slotButtonClicked (int, TQt::ButtonState state)
 

Protected Member Functions

TDEToolBar * toolBar (int index) const
 
TQPopupMenu * popupMenu (int index) const
 
void removeContainer (int index)
 
int findContainer (const TQWidget *widget) const
 
int findContainer (int id) const
 
void plugMainWindowAccel (TQWidget *w)
 
void addContainer (TQWidget *parent, int id)
 
void addContainer (TQWidget *parent, TQWidget *representative)
 
virtual void updateShortcut (int i)
 
virtual void updateShortcut (TQPopupMenu *menu, int id)
 
virtual void updateGroup (int id)
 
virtual void updateText (int i)
 
virtual void updateEnabled (int i)
 
virtual void updateIconSet (int i)
 
virtual void updateIcon (int i)
 
virtual void updateToolTip (int id)
 
virtual void updateWhatsThis (int i)
 
TQString whatsThisWithIcon () const
 
const KGuiItem & guiItem () const
 
virtual void virtual_hook (int id, void *data)
 

Protected Attributes

TDEActionCollection * m_parentCollection
 

Friends

class TDEActionCollection
 

Detailed Description

Class to encapsulate user-driven action or event.

The TDEAction class (and derived and super classes) provides a way to easily encapsulate a "real" user-selected action or event in your program.

For instance, a user may want to paste the contents of the clipboard or scroll down a document or quit the application. These are all actions – events that the user causes to happen. The TDEAction class allows the developer to deal with these actions in an easy and intuitive manner.

Specifically, the TDEAction class encapsulated the various attributes to an event/action. For instance, an action might have an icon that goes along with it (a clipboard for a "paste" action or scissors for a "cut" action). The action might have some text to describe the action. It will certainly have a method or function that actually executes the action! All these attributes are contained within the TDEAction object.

The advantage of dealing with Actions is that you can manipulate the Action without regard to the GUI representation of it. For instance, in the "normal" way of dealing with actions like "cut", you would manually insert a item for Cut into a menu and a button into a toolbar. If you want to disable the cut action for a moment (maybe nothing is selected), you would have to hunt down the pointer to the menu item and the toolbar button and disable both individually. Setting the menu item and toolbar item up uses very similar code - but has to be done twice!

With the Action concept, you simply "plug" the Action into whatever GUI element you want. The TDEAction class will then take care of correctly defining the menu item (with icons, accelerators, text, etc) or toolbar button.. or whatever. From then on, if you manipulate the Action at all, the effect will propogate through all GUI representations of it. Back to the "cut" example: if you want to disable the Cut Action, you would simply do 'cutAction->setEnabled(false)' and the menuitem and button would instantly be disabled!

This is the biggest advantage to the Action concept – there is a one-to-one relationship between the "real" action and all GUI representations of it.

TDEAction emits the activated() signal if the user activated the corresponding GUI element ( menu item, toolbar button, etc. )

If you are in the situation of wanting to map the activated() signal of multiple action objects to one slot, with a special argument bound to each action, then you might consider using TQSignalMapper . A tiny example:

TQSignalMapper *desktopNumberMapper = new TQSignalMapper( this );
connect( desktopNumberMapper, TQ_SIGNAL( mapped( int ) ),
this, TQ_SLOT( moveWindowToDesktop( int ) ) );
for ( uint i = 0; i < numberOfDesktops; ++i ) {
TDEAction *desktopAction = new TDEAction( i18n( "Move Window to Desktop %i" ).arg( i ), ... );
connect( desktopAction, TQ_SIGNAL( activated() ), desktopNumberMapper, TQ_SLOT( map() ) );
desktopNumberMapper->setMapping( desktopAction, i );
}
TDEAction
Class to encapsulate user-driven action or event.
Definition: tdeaction.h:203
TDEAction::TDEAction
TDEAction(const TQString &text, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
Constructs an action with text, potential keyboard shortcut, and a slot to call when this action is i...
Definition: tdeaction.cpp:123
TDEAction::activated
void activated()
Emitted when this action is activated.

General Usage:
The steps to using actions are roughly as follows

  • Decide which attributes you want to associate with a given action (icons, text, keyboard shortcut, etc)
  • Create the action using TDEAction (or derived or super class).
  • "Plug" the Action into whatever GUI element you want. Typically, this will be a menu or toolbar.

Detailed Example:
Here is an example of enabling a "New [document]" action

TDEAction *newAct = new TDEAction(i18n("&New"), "document-new",
TDEStdAccel::shortcut(TDEStdAccel::New),
this, TQ_SLOT(fileNew()),
actionCollection(), "new");
TDEStdAccel::shortcut
const TDEShortcut & shortcut(StdAccel id)

This line creates our action. It says that wherever this action is displayed, it will use "&New" as the text, the standard icon, and the standard shortcut. It further says that whenever this action is invoked, it will use the fileNew() slot to execute it.

TQPopupMenu *file = new TQPopupMenu;
newAct->plug(file);
TDEAction::plug
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
Definition: tdeaction.cpp:628

That just inserted the action into the File menu. The point is, it's not important in which menu it is: all manipulation of the item is done through the newAct object.

newAct->plug(toolBar());

And this inserted the Action into the main toolbar as a button.

That's it!

If you want to disable that action sometime later, you can do so with

newAct->setEnabled(false)
TDEAction::setEnabled
virtual void setEnabled(bool enable)
Enables or disables this action.
Definition: tdeaction.cpp:832

and both the menuitem in File and the toolbar button will instantly be disabled.

Do not delete a TDEAction object without unplugging it from all its containers. The simplest way to do that is to use the unplugAll() as in the following example:

newAct->unplugAll();
delete newAct;

Normally you will not need to do this as TDEActionCollection manages everything for you.

Note: if you are using a "standard" action like "new", "paste", "quit", or any other action described in the KDE UI Standards, please use the methods in the KStdAction class rather than defining your own.

Usage Within the XML Framework:
If you are using TDEAction within the context of the XML menu and toolbar building framework, then there are a few tiny changes. The first is that you must insert your new action into an action collection. The action collection (a TDEActionCollection) is, logically enough, a central collection of all of the actions defined in your application. The XML UI framework code in KXMLGUI classes needs access to this collection in order to build up the GUI (it's how the builder code knows which actions are valid and which aren't).

Also, if you use the XML builder framework, then you do not ever have to plug your actions into containers manually. The framework does that for you.

See also
KStdAction

Definition at line 202 of file tdeaction.h.

Member Enumeration Documentation

◆ ActivationReason

enum TDEAction::ActivationReason
Since
3.4

Definition at line 494 of file tdeaction.h.

Constructor & Destructor Documentation

◆ TDEAction() [1/11]

TDEAction::TDEAction ( const TQString &  text,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TDEActionCollection *  parent,
const char *  name 
)

Constructs an action with text, potential keyboard shortcut, and a slot to call when this action is invoked by the user.

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

This is the most common TDEAction used when you do not have a corresponding icon (note that it won't appear in the current version of the "Edit ToolBar" dialog, because an action needs an icon to be plugged in a toolbar...).

Parameters
textThe text that will be displayed.
cutThe corresponding keyboard shortcut.
receiverThe slot's parent.
slotThe slot to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

Definition at line 123 of file tdeaction.cpp.

◆ TDEAction() [2/11]

TDEAction::TDEAction ( const TQString &  text,
const TQIconSet &  pix,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TDEActionCollection *  parent,
const char *  name 
)

Constructs an action with text, icon, potential keyboard shortcut, and a slot to call when this action is invoked by the user.

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

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

Parameters
textThe text that will be displayed.
pixThe icon to display.
cutThe corresponding keyboard shortcut.
receiverThe slot's parent.
slotThe slot to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

Definition at line 140 of file tdeaction.cpp.

◆ TDEAction() [3/11]

TDEAction::TDEAction ( const TQString &  text,
const TQString &  pix,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TDEActionCollection *  parent,
const char *  name 
)

Constructs an action with text, icon, potential keyboard shortcut, 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 shortcut, set the cut param to 0.

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

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

Definition at line 131 of file tdeaction.cpp.

◆ TDEAction() [4/11]

TDEAction::TDEAction ( const KGuiItem &  item,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TDEActionCollection *  parent,
const char *  name 
)

The same as the above constructor, but with a KGuiItem providing the text and icon.

Parameters
itemThe KGuiItem with the label and (optional) icon.
cutThe corresponding keyboard shortcut (shortcut).
receiverThe slot's parent.
slotThe slot to invoke to execute this action.
parentThis action's parent.
nameAn internal name for this action.

Definition at line 149 of file tdeaction.cpp.

◆ TDEAction() [5/11]

TDEAction::TDEAction ( const TQString &  text,
const TDEShortcut &  cut = TDEShortcut(),
TQObject *  parent = 0,
const char *  name = 0 
)
Deprecated:

Definition at line 162 of file tdeaction.cpp.

◆ TDEAction() [6/11]

TDEAction::TDEAction ( const TQString &  text,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TQObject *  parent,
const char *  name = 0 
)
Deprecated:

Definition at line 169 of file tdeaction.cpp.

◆ TDEAction() [7/11]

TDEAction::TDEAction ( const TQString &  text,
const TQIconSet &  pix,
const TDEShortcut &  cut = TDEShortcut(),
TQObject *  parent = 0,
const char *  name = 0 
)
Deprecated:

Definition at line 177 of file tdeaction.cpp.

◆ TDEAction() [8/11]

TDEAction::TDEAction ( const TQString &  text,
const TQString &  pix,
const TDEShortcut &  cut = TDEShortcut(),
TQObject *  parent = 0,
const char *  name = 0 
)
Deprecated:

Definition at line 186 of file tdeaction.cpp.

◆ TDEAction() [9/11]

TDEAction::TDEAction ( const TQString &  text,
const TQIconSet &  pix,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TQObject *  parent,
const char *  name = 0 
)
Deprecated:

Definition at line 195 of file tdeaction.cpp.

◆ TDEAction() [10/11]

TDEAction::TDEAction ( const TQString &  text,
const TQString &  pix,
const TDEShortcut &  cut,
const TQObject *  receiver,
const char *  slot,
TQObject *  parent,
const char *  name = 0 
)
Deprecated:

Definition at line 205 of file tdeaction.cpp.

◆ TDEAction() [11/11]

TDEAction::TDEAction ( TQObject *  parent = 0,
const char *  name = 0 
)
Deprecated:

Definition at line 215 of file tdeaction.cpp.

◆ ~TDEAction()

TDEAction::~TDEAction ( )
virtual

Standard destructor.

Definition at line 222 of file tdeaction.cpp.

Member Function Documentation

◆ accel()

int TDEAction::accel ( ) const
Deprecated:
. Use shortcut(). Get the keyboard accelerator associated with this action.

Definition at line 571 of file tdeaction.cpp.

◆ activate

void TDEAction::activate ( )
virtualslot

Emulate user's interaction programmatically, by activating the action.

The implementation simply emits activated().

Definition at line 1104 of file tdeaction.cpp.

◆ activated [1/2]

void TDEAction::activated ( )
signal

Emitted when this action is activated.

◆ activated [2/2]

void TDEAction::activated ( TDEAction::ActivationReason  reason,
TQt::ButtonState  state 
)
signal

This signal allows to know the reason why an action was activated: whether it was due to a toolbar button, popupmenu, keyboard accel, or programmatically.

In the first two cases, it also allows to know which mouse button was used (Left or Middle), and whether keyboard modifiers were pressed (e.g. CTRL).

Note that this signal is emitted before the normal activated() signal. Yes, BOTH signals are always emitted, so that connecting to activated() still works. Applications which care about reason and state can either ignore the activated() signal for a given action and react to this one instead, or store the reason and state until the activated() signal is emitted.

Since
3.4

◆ addContainer() [1/2]

void TDEAction::addContainer ( TQWidget *  parent,
int  id 
)
protected

Definition at line 1088 of file tdeaction.cpp.

◆ addContainer() [2/2]

void TDEAction::addContainer ( TQWidget *  parent,
TQWidget *  representative 
)
protected

Definition at line 1096 of file tdeaction.cpp.

◆ container()

TQWidget * TDEAction::container ( int  index) const

Definition at line 1052 of file tdeaction.cpp.

◆ containerCount()

int TDEAction::containerCount ( ) const

Definition at line 1078 of file tdeaction.cpp.

◆ findContainer() [1/2]

int TDEAction::findContainer ( const TQWidget *  widget) const
protected

Definition at line 1202 of file tdeaction.cpp.

◆ findContainer() [2/2]

int TDEAction::findContainer ( int  id) const
protected

Definition at line 1222 of file tdeaction.cpp.

◆ getToolButtonID()

int TDEAction::getToolButtonID ( )
static

How it works.

Generate a toolbar button id. Made public for reimplementations.

TDEActionCollection is an organizing container for TDEActions. TDEActionCollection keeps track of the information necessary to handle configuration and shortcuts.

Focus Widget pointer: This is the widget which is the focus for action shortcuts. It is set either by passing a TQWidget* to the TDEActionCollection constructor or by calling setWidget() if the widget wasn't known when the object was initially constructed (as in KXMLGUIClient and KParts::PartBase)

Shortcuts: An action's shortcut will not not be connected unless a focus widget has been specified in TDEActionCollection.

XML Filename: This is used to save user-modified settings back to the *ui.rc file. It is set by KXMLGUIFactory.

Definition at line 76 of file tdeaction.cpp.

◆ group()

TQString TDEAction::group ( ) const
virtual

Definition at line 591 of file tdeaction.cpp.

◆ guiItem()

const KGuiItem & TDEAction::guiItem ( ) const
protected

Return the underlying KGuiItem.

Since
3.3

Definition at line 1283 of file tdeaction.cpp.

◆ hasIcon()

bool TDEAction::hasIcon ( ) const
virtual

Definition at line 1006 of file tdeaction.cpp.

◆ hasIconSet()

bool TDEAction::hasIconSet ( ) const
inline

Definition at line 421 of file tdeaction.h.

◆ icon()

TQString TDEAction::icon ( ) const
virtual

Definition at line 964 of file tdeaction.cpp.

◆ iconSet() [1/2]

TQIconSet TDEAction::iconSet ( ) const
inline

Remove in KDE4.

Definition at line 476 of file tdeaction.h.

◆ iconSet() [2/2]

TQIconSet TDEAction::iconSet ( TDEIcon::Group  group,
int  size = 0 
) const
virtual

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

In KDE4 set group default to TDEIcon::Small while removing the other iconSet() function.

Definition at line 1001 of file tdeaction.cpp.

◆ isEnabled()

bool TDEAction::isEnabled ( ) const
virtual

Returns true if this action is enabled.

Definition at line 596 of file tdeaction.cpp.

◆ isPlugged() [1/4]

bool TDEAction::isPlugged ( ) const
virtual

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

Since
3.1

Definition at line 273 of file tdeaction.cpp.

◆ isPlugged() [2/4]

bool TDEAction::isPlugged ( const TQWidget *  container) const

returns whether the action is plugged into the given container

Definition at line 278 of file tdeaction.cpp.

◆ isPlugged() [3/4]

bool TDEAction::isPlugged ( const TQWidget *  container,
const TQWidget *  _representative 
) const
virtual

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

Definition at line 289 of file tdeaction.cpp.

◆ isPlugged() [4/4]

bool TDEAction::isPlugged ( const TQWidget *  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 ) .

Definition at line 283 of file tdeaction.cpp.

◆ isShortcutConfigurable()

bool TDEAction::isShortcutConfigurable ( ) const
virtual

Returns true if this action's shortcut is configurable.

Reimplemented in TDESelectAction.

Definition at line 601 of file tdeaction.cpp.

◆ itemId()

int TDEAction::itemId ( int  index) const

Definition at line 1073 of file tdeaction.cpp.

◆ menuId()

int TDEAction::menuId ( int  i)
inline
Deprecated:
. for backwards compatibility. Use itemId()

Definition at line 663 of file tdeaction.h.

◆ parentCollection()

TDEActionCollection * TDEAction::parentCollection ( ) const

Definition at line 1272 of file tdeaction.cpp.

◆ plainText()

TQString TDEAction::plainText ( ) const
virtual

Definition at line 933 of file tdeaction.cpp.

◆ plug()

int TDEAction::plug ( TQWidget *  widget,
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 TDEAction object.

Parameters
widgetThe GUI element to display this action
indexThe position into which the action is plugged. If this is negative, the action is inserted at the end.

Reimplemented in TDEToggleAction, TDESelectAction, TDERecentFilesAction, TDEActionMenu, TDEToolBarPopupAction, TDEToggleToolBarAction, KWidgetAction, and TDEPasteTextAction.

Definition at line 628 of file tdeaction.cpp.

◆ plugAccel()

void TDEAction::plugAccel ( TDEAccel *  accel,
bool  configurable = true 
)
virtual
Deprecated:
. Shouldn't be used. No substitute available.

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

Parameters
accelThe TDEAccel collection which holds this accel
configurableIf the shortcut is configurable via the TDEAccel configuration dialog (this is somehow deprecated since there is now a TDEAction key configuration dialog).

Definition at line 773 of file tdeaction.cpp.

◆ plugMainWindowAccel()

void TDEAction::plugMainWindowAccel ( TQWidget *  w)
protected

Definition at line 817 of file tdeaction.cpp.

◆ popupMenu()

TQPopupMenu * TDEAction::popupMenu ( int  index) const
protected

Definition at line 1063 of file tdeaction.cpp.

◆ removeContainer()

void TDEAction::removeContainer ( int  index)
protected

Definition at line 1242 of file tdeaction.cpp.

◆ representative()

TQWidget * TDEAction::representative ( int  index) const

Definition at line 1068 of file tdeaction.cpp.

◆ setAccel()

void TDEAction::setAccel ( int  key)
Deprecated:
. Use setShortcut(). Sets the keyboard accelerator associated with this action.

Definition at line 507 of file tdeaction.cpp.

◆ setDisabled

void TDEAction::setDisabled ( bool  disable)
inlineslot

Calls setEnabled( !disable ).

Since
3.5

Definition at line 553 of file tdeaction.h.

◆ setEnabled

void TDEAction::setEnabled ( bool  enable)
virtualslot

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.

Definition at line 832 of file tdeaction.cpp.

◆ setGroup

void TDEAction::setGroup ( const TQString &  grp)
virtualslot

Definition at line 577 of file tdeaction.cpp.

◆ setIcon

void TDEAction::setIcon ( const TQString &  icon)
virtualslot

Definition at line 938 of file tdeaction.cpp.

◆ setIconSet

void TDEAction::setIconSet ( const TQIconSet &  iconSet)
virtualslot

Sets the TQIconSet from which the icons used to display this action will be chosen.

Definition at line 969 of file tdeaction.cpp.

◆ setShortcut

bool TDEAction::setShortcut ( const TDEShortcut &  cut)
virtualslot

Sets the keyboard shortcut associated with this action.

Definition at line 414 of file tdeaction.cpp.

◆ setShortcutConfigurable

void TDEAction::setShortcutConfigurable ( bool  b)
virtualslot

Indicate whether the user may configure the action's shortcut.

Definition at line 874 of file tdeaction.cpp.

◆ setShortcutText()

void TDEAction::setShortcutText ( const TQString &  s)

Definition at line 565 of file tdeaction.cpp.

◆ setStatusText()

void TDEAction::setStatusText ( const TQString &  text)
inline
Deprecated:
. Use setToolTip instead (they do the same thing now).

Definition at line 657 of file tdeaction.h.

◆ setText

void TDEAction::setText ( const TQString &  text)
virtualslot

Sets the text associated with this action.

The text is used for menu and toolbar labels etc.

Reimplemented in TDEToolBarLabelAction.

Definition at line 879 of file tdeaction.cpp.

◆ setToolTip

void TDEAction::setToolTip ( const TQString &  tt)
virtualslot

Sets the tooltip text for the action.

This will be used as a tooltip for a toolbar button, as a statusbar help-text for a menu item, and it also appears in the toolbar editor, to describe the action.

For the tooltip to show up on the statusbar you will need to connect a couple of the actionclass signals to the toolbar. The easiest way of doing this is in your main window class, when you create a statusbar. See the TDEActionCollection class for more details.

See also
TDEActionCollection

Definition at line 606 of file tdeaction.cpp.

◆ setWhatsThis

void TDEAction::setWhatsThis ( const TQString &  text)
virtualslot

Sets 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 include QML markup as well as raw text.

Definition at line 1011 of file tdeaction.cpp.

◆ shortcut()

const TDEShortcut & TDEAction::shortcut ( ) const
virtual

Get the keyboard shortcut associated with this action.

Definition at line 550 of file tdeaction.cpp.

◆ shortcutDefault()

const TDEShortcut & TDEAction::shortcutDefault ( ) const
virtual

Get the default shortcut for this action.

Definition at line 555 of file tdeaction.cpp.

◆ shortcutText()

TQString TDEAction::shortcutText ( ) const

Definition at line 560 of file tdeaction.cpp.

◆ slotActivated

void TDEAction::slotActivated ( )
protectedvirtualslot

Definition at line 1110 of file tdeaction.cpp.

◆ slotButtonClicked

void TDEAction::slotButtonClicked ( int  ,
TQt::ButtonState  state 
)
protectedslot
Since
3.4

Definition at line 1156 of file tdeaction.cpp.

◆ slotDestroyed

void TDEAction::slotDestroyed ( )
protectedvirtualslot

Definition at line 1167 of file tdeaction.cpp.

◆ slotKeycodeChanged

void TDEAction::slotKeycodeChanged ( )
protectedvirtualslot

Definition at line 1264 of file tdeaction.cpp.

◆ slotPopupActivated

void TDEAction::slotPopupActivated ( )
protectedslot
Since
3.4

Definition at line 1125 of file tdeaction.cpp.

◆ statusText()

TQString TDEAction::statusText ( ) const
inline

Definition at line 645 of file tdeaction.h.

◆ tdeaccelCount()

uint TDEAction::tdeaccelCount ( ) const
Since
3.1

Definition at line 1083 of file tdeaction.cpp.

◆ text()

TQString TDEAction::text ( ) const
virtual

Get the text associated with this action.

Definition at line 928 of file tdeaction.cpp.

◆ toolBar()

TDEToolBar * TDEAction::toolBar ( int  index) const
protected

Definition at line 1058 of file tdeaction.cpp.

◆ toolTip()

TQString TDEAction::toolTip ( ) const
virtual

Get the tooltip text for the action.

Reimplemented in TDEToggleAction.

Definition at line 623 of file tdeaction.cpp.

◆ unplug()

void TDEAction::unplug ( TQWidget *  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.

Reimplemented in KWidgetAction.

Definition at line 745 of file tdeaction.cpp.

◆ unplugAccel()

void TDEAction::unplugAccel ( )
virtual
Deprecated:
. Complement method to plugAccel(). Disconnect this action from the TDEAccel.

Definition at line 807 of file tdeaction.cpp.

◆ unplugAll()

void TDEAction::unplugAll ( )

Definition at line 1277 of file tdeaction.cpp.

◆ updateEnabled()

void TDEAction::updateEnabled ( int  i)
protectedvirtual

Definition at line 862 of file tdeaction.cpp.

◆ updateGroup()

void TDEAction::updateGroup ( int  id)
protectedvirtual

Definition at line 586 of file tdeaction.cpp.

◆ updateIcon()

void TDEAction::updateIcon ( int  i)
protectedvirtual

Definition at line 948 of file tdeaction.cpp.

◆ updateIconSet()

void TDEAction::updateIconSet ( int  i)
protectedvirtual

Definition at line 979 of file tdeaction.cpp.

◆ updateShortcut() [1/2]

void TDEAction::updateShortcut ( int  i)
protectedvirtual

Definition at line 513 of file tdeaction.cpp.

◆ updateShortcut() [2/2]

void TDEAction::updateShortcut ( TQPopupMenu *  menu,
int  id 
)
protectedvirtual

Definition at line 526 of file tdeaction.cpp.

◆ updateText()

void TDEAction::updateText ( int  i)
protectedvirtual

Definition at line 908 of file tdeaction.cpp.

◆ updateToolTip()

void TDEAction::updateToolTip ( int  id)
protectedvirtual

Definition at line 615 of file tdeaction.cpp.

◆ updateWhatsThis()

void TDEAction::updateWhatsThis ( int  i)
protectedvirtual

Definition at line 1020 of file tdeaction.cpp.

◆ virtual_hook()

void TDEAction::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 1288 of file tdeaction.cpp.

◆ whatsThis()

TQString TDEAction::whatsThis ( ) const
virtual

Get the What's this text for the action.

Definition at line 1039 of file tdeaction.cpp.

◆ whatsThisWithIcon()

TQString TDEAction::whatsThisWithIcon ( ) const
protected

Definition at line 1044 of file tdeaction.cpp.

Friends And Related Function Documentation

◆ TDEActionCollection

friend class TDEActionCollection
friend

Definition at line 204 of file tdeaction.h.

Member Data Documentation

◆ m_parentCollection

TDEActionCollection* TDEAction::m_parentCollection
protected

Definition at line 596 of file tdeaction.h.


The documentation for this class was generated from the following files:
  • tdeaction.h
  • tdeaction.cpp

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.