fw4spl
SSignalShortcut.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "guiQt/config.hpp"
10 
11 #include <fwServices/IService.hpp>
12 
13 #include <QShortcut>
14 
15 namespace guiQt
16 {
17 
34 class GUIQT_CLASS_API SSignalShortcut : public QObject,
36 {
37 Q_OBJECT
38 public:
39 
41 
43  typedef ::fwCom::Signal< void () > ActivatedShortcutSignalType;
44 
46  GUIQT_API SSignalShortcut() noexcept;
47 
49  GUIQT_API virtual ~SSignalShortcut() noexcept;
50 
51 protected:
52 
57  GUIQT_API virtual void configuring() override;
59 
63  GUIQT_API virtual void starting() override;
64 
68  GUIQT_API virtual void stopping() override;
69 
73  GUIQT_API virtual void updating() override;
74 
75 private Q_SLOTS:
76  void onActivation();
77 
78 private:
79 
81  std::string m_shortcut;
82 
85  std::string m_sid;
86 
89  std::string m_wid;
90 
92  QShortcut* m_shortcutObject;
93 };
94 
95 }
Base class for all services.
Definition: IService.hpp:61
STL namespace.
This service sends a signal when the associated shortcut is activated.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace guiQt contains the basic services to build the application IHM with Qt...
Definition: Code.hpp:21