LibEngsas
Public Slots | Public Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
EAction Class Reference

QAction replacement, which handles "iconsAndText"-option and QIcon::fromTheme. More...

#include <eaction.h>

+ Inheritance diagram for EAction:
+ Collaboration diagram for EAction:

Public Slots

void setEnabled (bool status)
 
void setDisabled (bool status)
 

Public Member Functions

 EAction (QString standardIconName, QString iconPath, const QString &text, QObject *parent=0, bool enableText=false)
 
 EAction (const QString &text, QObject *parent=0)
 
 ~EAction ()
 
QAction * actionWithText ()
 
void setText (const QString &text)
 
void setIcon (const QIcon &icon)
 
void setIcon (QString standardIconName, QString iconPath)
 
void setShowText (bool anytime=true)
 Determines, if the text is hidden (Default), when an icon is there or not. More...
 
bool showText () const
 

Properties

bool showText
 

Private Slots

void triggeredByPass ()
 

Private Member Functions

void init (bool enableText)
 

Private Attributes

QString myText
 
bool iconsAndText
 
bool myShowText
 
QPointer< QAction > myActionWithText
 

Detailed Description

QAction replacement, which handles "iconsAndText"-option and QIcon::fromTheme.

To get an action which has enabled the text in any cases, call actionWithText(). This can be useful, if this action should be used in a QToolBar (only icons) and in a context menu (Text needed in any case).

See Also
EPushButton

Constructor & Destructor Documentation

EAction::EAction ( QString  standardIconName,
QString  iconPath,
const QString &  text,
QObject *  parent = 0,
bool  enableText = false 
)

Creates an action and tries to set the icon to the standardIconName. If this is not possible (due to unsupported Qt Version or their is no standard icon, it uses iconPath to load icon from resource. It also sets the text to text. Further on, if enableText is set to true, text is shown anytime and iconsAndText is ignored.

+ Here is the call graph for this function:

EAction::EAction ( const QString &  text,
QObject *  parent = 0 
)

+ Here is the call graph for this function:

EAction::~EAction ( )

Member Function Documentation

QAction * EAction::actionWithText ( )
Returns
If the returned action is triggered, this action emit the triggered signal too! The returned action is alse enabled or disabled when this action is enabled or disabled. Shortly, this action takes care of the returned action and you must not handle it. Epsecially, don't delete the returned action, this Action will do it.

+ Here is the call graph for this function:

void EAction::init ( bool  enableText)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EAction::setDisabled ( bool  status)
slot

+ Here is the call graph for this function:

void EAction::setEnabled ( bool  status)
slot

+ Here is the caller graph for this function:

void EAction::setIcon ( const QIcon &  icon)

+ Here is the caller graph for this function:

void EAction::setIcon ( QString  standardIconName,
QString  iconPath 
)

+ Here is the call graph for this function:

void EAction::setShowText ( bool  anytime = true)

Determines, if the text is hidden (Default), when an icon is there or not.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EAction::setText ( const QString &  text)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool EAction::showText ( ) const

+ Here is the caller graph for this function:

void EAction::triggeredByPass ( )
privateslot

+ Here is the caller graph for this function:

Member Data Documentation

bool EAction::iconsAndText
private
QPointer<QAction> EAction::myActionWithText
private
bool EAction::myShowText
private
QString EAction::myText
private

Property Documentation

bool EAction::showText
readwrite

if set to true, the text will be shown in any case if set to false (default), the text will only be shown, if no icon is set or iconsAndText is true


The documentation for this class was generated from the following files: