OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ContextMenu.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTGui/MenuCfg.h"
12
13// Qt header
14#include <QtWidgets/qmenu.h>
15
16namespace ot {
17
18 class OT_WIDGETS_API_EXPORT ContextMenu : public QMenu {
19 Q_OBJECT
21 public:
22 ContextMenu(QWidget* _parent = (QWidget*) nullptr);
23 ContextMenu(const MenuCfg& _config, QWidget* _parent = (QWidget*) nullptr);
24 virtual ~ContextMenu();
25
26 void setFromConfiguration(const MenuCfg& _config);
27
28 void setContextMenuName(const std::string& _name) { m_name = _name; };
29 const std::string& getContextMenuName(void) const { return m_name; };
30
31 Q_SIGNALS:
32 void contextActionTriggered(const std::string& _actionName);
33
34 private Q_SLOTS:
35 void slotActionTriggered(void);
36 void slotActionTriggered(const std::string& _actionName);
37
38 private:
39 std::string m_name;
40 };
41
42}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition ContextMenu.h:18
const std::string & getContextMenuName(void) const
Definition ContextMenu.h:29
void contextActionTriggered(const std::string &_actionName)
void setContextMenuName(const std::string &_name)
Definition ContextMenu.h:28
Definition MenuCfg.h:17
Definition Connector.h:8