Choreonoid  1.8
Menu.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_MENU_H
6 #define CNOID_BASE_MENU_H
7 
8 #include <cnoid/Signal>
9 #include <QMenu>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT Menu : public QMenu
15 {
16  Q_OBJECT
17 
18 public:
19  Menu(QWidget* parent = 0);
20  Menu(const QString& title, QWidget* parent = 0);
21  ~Menu();
22 
23  SignalProxy<void(QAction*)> sigTriggered();
24  SignalProxy<void()> sigAboutToShow();
25  SignalProxy<void()> sigAboutToHide();
26 
27 private Q_SLOTS:
28  void onTriggered(QAction* action);
29  void onAboutToShow();
30  void onAboutToHide();
31 
32 private:
33  Signal<void(QAction*)>* sigTriggered_;
34  Signal<void()>* sigAboutToShow_;
35  Signal<void()>* sigAboutToHide_;
36 
37  void initialize();
38 };
39 
40 }
41 
42 #endif
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Signal
Definition: Signal.h:165
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::Menu
Definition: Menu.h:14