QAction replacement, which handles "iconsAndText"-option and QIcon::fromTheme.
More...
#include <eaction.h>
|
| 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 |
|
|
void | init (bool enableText) |
|
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
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.
EAction::EAction |
( |
const QString & |
text, |
|
|
QObject * |
parent = 0 |
|
) |
| |
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.
void EAction::init |
( |
bool |
enableText | ) |
|
|
private |
void EAction::setDisabled |
( |
bool |
status | ) |
|
|
slot |
void EAction::setEnabled |
( |
bool |
status | ) |
|
|
slot |
void EAction::setIcon |
( |
const QIcon & |
icon | ) |
|
void EAction::setIcon |
( |
QString |
standardIconName, |
|
|
QString |
iconPath |
|
) |
| |
void EAction::setShowText |
( |
bool |
anytime = true | ) |
|
Determines, if the text is hidden (Default), when an icon is there or not.
void EAction::setText |
( |
const QString & |
text | ) |
|
bool EAction::showText |
( |
| ) |
const |
void EAction::triggeredByPass |
( |
| ) |
|
|
privateslot |
bool EAction::iconsAndText |
|
private |
QPointer<QAction> EAction::myActionWithText |
|
private |
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: