4 * Created on: Feb 2, 2015
8 #ifndef XGUI_HISTORYMENU_H_
9 #define XGUI_HISTORYMENU_H_
14 #include <ModuleBase_ActionInfo.h>
18 class QListWidgetItem;
21 * \class XGUI_HistoryMenu
23 * \brief Extends regular QToolButton of QAction with HistoryMenu (stack of actions)
25 class XGUI_EXPORT XGUI_HistoryMenu : public QMenu
29 /// Creates history menu for button
30 explicit XGUI_HistoryMenu(QToolButton* theParent);
31 /// Creates history menu for action
32 explicit XGUI_HistoryMenu(QAction* theParent);
33 virtual ~XGUI_HistoryMenu();
36 /// Signal. Emited then n-th action is selected in stack
37 void actionSelected(int);
40 /// Set list of actions
41 void setHistory(const QList<ActionInfo>&);
44 /// Unselects all items when cursor leaves the list
45 virtual void leaveEvent(QEvent *);
48 /// Selects all items in stack to the given item including it
49 void setStackSelectedTo(QListWidgetItem *);
50 /// Emits actionSelected() signal.
51 void onItemPressed(QListWidgetItem *);
52 /// Initializes internal controls of the Menu
56 QListWidget* myHistoryList; ///< List to contain actions
59 #endif /* XGUI_OPERATIONSSTACKPOPUP_H_ */