Action with associated list of items. More...
#include <QtxListAction.h>

Data Structures | |
| class | ListFrame |
| Expanding frame with action list and comment. More... | |
| class | ListWidget |
| List of actions. More... | |
| class | ScrollEvent |
| Event for the scrolling in the list of actions. More... | |
Public Types | |
| enum | { Item, SubMenu } |
Popup mode. More... | |
Signals | |
| void | triggered (int) |
Public Member Functions | |
| QtxListAction (QObject *=0) | |
| Constructor. | |
| QtxListAction (const QString &, int, QObject *) | |
| Constructor. | |
| QtxListAction (const QString &, const QString &, int, QObject *) | |
| Constructor. | |
| QtxListAction (const QIcon &, const QString &, int, QObject *) | |
| Constructor. | |
| QtxListAction (const QString &, const QIcon &, const QString &, int, QObject *) | |
| Constructor. | |
| virtual | ~QtxListAction () |
| Destructor. | |
| int | popupMode () const |
| Get popup mode. | |
| void | setPopupMode (const int) |
| Set popup mode. | |
| QStringList | names () const |
| Get current list of names. | |
| void | addNames (const QStringList &, bool=true) |
| Add names to the list. | |
| void | setComment (const QString &, const QString &=QString()) |
| Set the format Qt string for comments displayed under the list of actions for one action and for several actions. | |
| int | linesNumber () const |
| Get maximum numer of lines shown without activation of vertical scroll bar. | |
| int | charsNumber () const |
| Get maximum numer of characters in the line. | |
| void | setLinesNumber (const int) |
| Set maximum numer of lines shown without activation of vertical scroll bar. | |
| void | setCharsNumber (const int) |
| Set maximum numer of characters in the line. | |
| virtual bool | eventFilter (QObject *, QEvent *) |
| Customize action events. | |
| QString | shortcutActionName () const |
| Return shortcut action name for the action. | |
| void | setShortcutActionName (const QString &) |
| Set shortcut action name to the action. | |
Data Fields | |
| enum QtxListAction:: { ... } | PopupMode |
Protected Member Functions | |
| virtual QWidget * | createWidget (QWidget *) |
| Create action widget. | |
| virtual void | deleteWidget (QWidget *) |
| Destroy action widget. | |
| virtual void | addedTo (QWidget *) |
| Called when the action is added to the widget. | |
| virtual void | removedFrom (QWidget *) |
| Called when the action is removed from the widget. | |
| virtual void | customEvent (QEvent *) |
| Process notification events. | |
Private Slots | |
| void | onChanged () |
| Called the action contents is changed. | |
| void | onMultiple (const int) |
| Called when multiple items are selected. | |
| void | onSingle (bool=false) |
| Called when a user click action button. | |
| void | onTriggered (bool=false) |
| Called when user activates an items in the popup sub menu. | |
Private Member Functions | |
| void | initialize () |
| Initialize the action. | |
Private Attributes | |
| ListFrame * | myFrame |
| list of actions shown as submenu | |
Friends | |
| class | QtxListAction::ListFrame |
This class can be helpuful, for example, for creation of Undo/Redo toolbar items which show list of available commands in the popup list box.
| anonymous enum |
| QtxListAction::QtxListAction | ( | QObject * | parent = 0 | ) |
| parent | parent object |
References initialize().
| QtxListAction::QtxListAction | ( | const QString & | menuText, |
| int | accel, | ||
| QObject * | parent | ||
| ) |
| menuText | menu text |
| accel | key accelerator |
| parent | parent object |
References initialize().
| QtxListAction::QtxListAction | ( | const QString & | text, |
| const QString & | menuText, | ||
| int | accel, | ||
| QObject * | parent | ||
| ) |
| text | action description text (tooltip) |
| menuText | menu text |
| accel | key accelerator |
| parent | parent object |
References initialize().
| QtxListAction::QtxListAction | ( | const QIcon & | icon, |
| const QString & | menuText, | ||
| int | accel, | ||
| QObject * | parent | ||
| ) |
| icon | action icon |
| menuText | menu text |
| accel | key accelerator |
| parent | parent object |
References initialize().
| QtxListAction::QtxListAction | ( | const QString & | text, |
| const QIcon & | icon, | ||
| const QString & | menuText, | ||
| int | accel, | ||
| QObject * | parent | ||
| ) |
| text | action description text (tooltip) |
| icon | action icon |
| menuText | menu text |
| accel | key accelerator |
| parent | parent object |
References initialize().
| QtxListAction::~QtxListAction | ( | ) | [virtual] |
References myFrame.
| int QtxListAction::popupMode | ( | ) | const |
| void QtxListAction::setPopupMode | ( | const int | mode | ) |
| mode | new popup mode (QtxListAction.PopupMode) |
References Item, onChanged(), and popupMode().
| QStringList QtxListAction::names | ( | ) | const |
References myFrame, and QtxListAction.ListFrame.names().
| void QtxListAction::addNames | ( | const QStringList & | names, |
| bool | clear = true |
||
| ) |
Truncates each name to fit the frame width. Method setCharsNumber() can be used to change the frame width (in characters).
| names | list of names to be added |
| clear | if true, remove the old contents from the list |
References QtxListAction.ListFrame.addNames(), QtxListAction.ListFrame.clear(), myFrame, and onChanged().
| void QtxListAction::setComment | ( | const QString & | c, |
| const QString & | sc = QString() |
||
| ) |
Example: "Undo %1 actions" format string will work as "Undo 3 actions" when 3 actions are selected. The default format string is "%1".
| c | single action comment format |
| c | multiple actions comment format |
References myFrame, QtxListAction.ListFrame.setMultipleComment(), and QtxListAction.ListFrame.setSingleComment().
| int QtxListAction::linesNumber | ( | ) | const |
References QtxListAction.ListFrame.linesNumber(), and myFrame.
| int QtxListAction::charsNumber | ( | ) | const |
If the name length is greater than this value, it will be truncated.
References QtxListAction.ListFrame.charsNumber(), and myFrame.
| void QtxListAction::setLinesNumber | ( | const int | nlines | ) |
| nlines | number of lines (5 by default) |
References myFrame, and QtxListAction.ListFrame.setLinesNumber().
| void QtxListAction::setCharsNumber | ( | const int | nchars | ) |
If the name length is greater than this value, it will be truncated.
| maxChars | number of characters (5 by default) |
References myFrame, and QtxListAction.ListFrame.setCharsNumber().
| void QtxListAction.triggered | ( | int | ) | [signal] |
| void QtxListAction::onChanged | ( | ) | [private, slot] |
References test_table.a, myFrame, QtxListAction.ListFrame.names(), onTriggered(), and triggered().
| void QtxListAction::onMultiple | ( | const int | numActions | ) | [private, slot] |
References myFrame, and triggered().
| void QtxListAction::onSingle | ( | bool | = false | ) | [private, slot] |
| on | (not used) |
References onMultiple().
| void QtxListAction::onTriggered | ( | bool | = false | ) | [private, slot] |
| on | (not used) |
References triggered().
This function is called whenever the action is added to a container widget that supports custom widgets like menu or toolbar.
| parent | container widget the action is added to |
References myFrame, names(), and onSingle().
| void QtxListAction::deleteWidget | ( | QWidget * | widget | ) | [protected, virtual] |
This function is called whenever the action is removed from a container widget that supports custom widgets like menu or toolbar.
| widget | container widget the action is removed from |
| void QtxListAction::initialize | ( | ) | [private] |
Sends a notification event to the action when it is added to the widget or removed from it in order to perform custom processing.
| o | object |
| e | event |
true if further event processing should be stopped | QString QtxAction::shortcutActionName | ( | ) | const [inherited] |
References QtxAction.myShortcutActionName.
| void QtxAction::setShortcutActionName | ( | const QString & | shortcutAction | ) | [inherited] |
Shortcut action name is used for shortcuts customization.
| shortcutAction | shortcut action name |
References QtxAction.myShortcutActionName.
| void QtxAction::addedTo | ( | QWidget * | ) | [protected, virtual, inherited] |
This method can be redefined in the subclasses to customize the action behavior. Base implementation does nothing.
| w | widget (should be menu or toolbar) |
Reimplemented in LightApp_ModuleAction, QtxActionSet, QtxDockAction, QtxWorkspaceAction, and QtxWorkstackAction.
| void QtxAction::removedFrom | ( | QWidget * | ) | [protected, virtual, inherited] |
This method can be redefined in the subclasses to customize the action behavior. Base implementation does nothing.
| w | widget (should be menu or toolbar) |
Reimplemented in LightApp_ModuleAction, QtxActionSet, QtxDockAction, QtxWorkspaceAction, and QtxWorkstackAction.
| void QtxAction::customEvent | ( | QEvent * | e | ) | [protected, virtual, inherited] |
Calls addedTo() method when the action is added to the widget and removedFrom() when it is removed from the widget in order to perform custom processing.
| e | noification event |
References QtxAction.addedTo(), QtxAction.ActionNotify.isAdded(), QtxAction.removedFrom(), and QtxAction.ActionNotify.widget().
friend class QtxListAction::ListFrame [friend] |
| enum { ... } QtxListAction.PopupMode |
ListFrame* QtxListAction.myFrame [private] |