![]() |
Scribus
Open source desktop publishing at your fingertips
|
#include <scraction.h>
Public Types | |
enum | ActionType { Normal, DataInt, DataDouble, DataQString, RecentFile, DLL, Window, RecentScript, UnicodeChar, Layer, ActionDLL, RecentPaste, ActionDLLSE } |
Public Slots | |
void | toggle () |
Signals | |
void | triggeredData (QVariant) |
void | triggeredData (int) |
void | triggeredData (double) |
void | triggeredData (QString) |
void | triggeredData (ScribusDoc *) |
void | triggeredData (QWidget *, ScribusDoc *) |
void | toggledData (bool, int) |
void | toggledData (bool, double) |
void | toggledData (bool, QString) |
void | triggeredUnicodeShortcut (int) |
Public Member Functions | |
ScrAction (QObject *parent) | |
Constructor from QAction, sets menuType to Normal. More... | |
ScrAction (const QString &menuText, QKeySequence accel, QObject *parent) | |
Constructor from QAction, sets menuType to normal. More... | |
ScrAction (ActionType aType, const QString &menuText, QKeySequence accel, QObject *parent, QVariant d=QVariant()) | |
Constructor for an action that may require a specific menu type, such as a DLL menu. More... | |
ScrAction (ActionType aType, const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent, QVariant d=QVariant()) | |
ScrAction (const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent) | |
Constructor for a normal action. Stores iconset. More... | |
ScrAction (QKeySequence accel, QObject *parent, QVariant data=QVariant()) | |
Constructor for a Unicode action. More... | |
int | getMenuIndex () const |
Return the stored menuIndex as QActions cannot deal with these well. More... | |
QString | cleanMenuText () |
Return a copy of the menu text, without the &s, possibility to remove ellipses in future. More... | |
void | setToolTipFromTextAndShortcut () |
void | setStatusTextAndShortcut (const QString &statusText) |
bool | isDLLAction () const |
Return true if action is a DLL. More... | |
int | dllID () const |
Return DLL ID if the action is from a DLL, otherwise return -1. More... | |
void | setToggleAction (bool isToggle, bool fakeToggle=false) |
Connect the internal toggle connections. Fake toggle actions are toggle actions but we connect activated() only, eg itemLock. This means they can be setOn() to the status of an item's bool, eg isLocked(), without toggling anything. More... | |
void | saveShortcut () |
Store the shortcut in a private variable as these must be removed in editmode. More... | |
void | restoreShortcut () |
Restore the saved shortcut to be the active one. More... | |
ActionType | actionType () |
Return the action data type. More... | |
int | actionInt () const |
Return the action data of int action type. More... | |
double | actionDouble () const |
const QString | actionQString () |
void | setActionQString (const QString &) |
void | setTexts (const QString &newText) |
Set up text and menuText at the same time. | |
Protected Member Functions | |
void | initScrAction () |
void | addedTo (int index, QMenu *menu) |
Overridden addedTo QPopupmenu based function to save a pointer to the QPopupMenu we are adding to. More... | |
Protected Attributes | |
int | menuIndex |
ActionType | _actionType |
QMenu * | popupMenuAddedTo |
QKeySequence | savedKeySequence |
bool | shortcutSaved |
bool | fakeToggle |
QIcon | m_icon |
ScrAction::ScrAction | ( | QObject * | parent | ) |
Constructor from QAction, sets menuType to Normal.
parent | Parent object of this action |
ScrAction::ScrAction | ( | const QString & | menuText, |
QKeySequence | accel, | ||
QObject * | parent | ||
) |
Constructor from QAction, sets menuType to normal.
menuText | Text to be in the menus for this action |
accel | Accelerator QKeySequence |
parent | Parent object of this action |
ScrAction::ScrAction | ( | ActionType | aType, |
const QString & | menuText, | ||
QKeySequence | accel, | ||
QObject * | parent, | ||
QVariant | d = QVariant() |
||
) |
Constructor for an action that may require a specific menu type, such as a DLL menu.
mType | menuType, of Normal, RecentFile or DLL |
icon16 | Iconset for the action |
icon22 | Iconset for the action |
menuText | Text to be in the menus for this action |
accel | Accelerator QKeySequence |
parent | Parent of this action |
extraInt | extra int value |
extraDouble | extra double value |
extraQString | extra QString value |
ScrAction::ScrAction | ( | const QPixmap & | icon16, |
const QPixmap & | icon22, | ||
const QString & | menuText, | ||
QKeySequence | accel, | ||
QObject * | parent | ||
) |
Constructor for a normal action. Stores iconset.
icon | Iconset for the action |
menuText | Text to be in the menus for this action |
accel | Accelerator QKeySequence |
parent | Parent of this action |
ScrAction::ScrAction | ( | QKeySequence | accel, |
QObject * | parent, | ||
QVariant | data = QVariant() |
||
) |
Constructor for a Unicode action.
accel | Accelerator QKeySequence |
parent | Parent of this action |
extraInt | extra int value |
extraQString | extra QString value |
int ScrAction::actionInt | ( | ) | const |
Return the action data of int action type.
ScrAction::ActionType ScrAction::actionType | ( | ) |
Return the action data type.
|
protected |
Overridden addedTo QPopupmenu based function to save a pointer to the QPopupMenu we are adding to.
index | The saved index within the QPopupMenu |
menu | The menu we are adding this action to |
QString ScrAction::cleanMenuText | ( | ) |
Return a copy of the menu text, without the &s, possibility to remove ellipses in future.
QString | Stripped copy of the menu text |
int ScrAction::dllID | ( | ) | const |
Return DLL ID if the action is from a DLL, otherwise return -1.
int | DLL ID or -1 |
int ScrAction::getMenuIndex | ( | ) | const |
Return the stored menuIndex as QActions cannot deal with these well.
int | Index of menu the action was inserted into |
bool ScrAction::isDLLAction | ( | ) | const |
Return true if action is a DLL.
bool | True if action is from a DLL |
void ScrAction::restoreShortcut | ( | ) |
Restore the saved shortcut to be the active one.
void ScrAction::saveShortcut | ( | ) |
Store the shortcut in a private variable as these must be removed in editmode.
void ScrAction::setToggleAction | ( | bool | isToggle, |
bool | fakeToggle = false |
||
) |
Connect the internal toggle connections. Fake toggle actions are toggle actions but we connect activated() only, eg itemLock. This means they can be setOn() to the status of an item's bool, eg isLocked(), without toggling anything.