1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
5 * Created on: Feb 2, 2015
9 #ifndef XGUI_HISTORYMENU_H_
10 #define XGUI_HISTORYMENU_H_
15 #include <ModuleBase_ActionInfo.h>
19 class QListWidgetItem;
22 * \class XGUI_HistoryMenu
24 * \brief Extends regular QToolButton of QAction with HistoryMenu (stack of actions)
26 class XGUI_EXPORT XGUI_HistoryMenu : public QMenu
30 /// Creates history menu for button
31 explicit XGUI_HistoryMenu(QToolButton* theParent);
32 /// Creates history menu for action
33 explicit XGUI_HistoryMenu(QAction* theParent);
34 virtual ~XGUI_HistoryMenu();
37 /// Signal. Emited then n-th action is selected in stack
38 void actionSelected(int);
41 /// Set list of actions
42 void setHistory(const QList<ActionInfo>&);
45 /// Unselects all items when cursor leaves the list
46 virtual void leaveEvent(QEvent *);
49 /// Selects all items in stack to the given item including it
50 void setStackSelectedTo(QListWidgetItem *);
51 /// Emits actionSelected() signal.
52 void onItemPressed(QListWidgetItem *);
53 /// Initializes internal controls of the Menu
57 QListWidget* myHistoryList; ///< List to contain actions
60 #endif /* XGUI_OPERATIONSSTACKPOPUP_H_ */