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
9
#include "
OTCore/OTClassHelper.h
"
10
#include "
OTGui/MenuCfg.h
"
11
#include "
OTWidgets/OTWidgetsAPIExport.h
"
12
13
// Qt header
14
#include <QtWidgets/qmenu.h>
15
16
namespace
ot
{
17
18
class
OT_WIDGETS_API_EXPORT
ContextMenu
:
public
QMenu {
19
Q_OBJECT
20
OT_DECL_NOCOPY
(
ContextMenu
)
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
}
MenuCfg.h
OTClassHelper.h
This file contains defines that may be used simplyfy class creation.
OT_DECL_NOCOPY
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition
OTClassHelper.h:14
OTWidgetsAPIExport.h
OT_WIDGETS_API_EXPORT
#define OT_WIDGETS_API_EXPORT
Definition
OTWidgetsAPIExport.h:12
ot::ContextMenu
Definition
ContextMenu.h:18
ot::ContextMenu::getContextMenuName
const std::string & getContextMenuName(void) const
Definition
ContextMenu.h:29
ot::ContextMenu::contextActionTriggered
void contextActionTriggered(const std::string &_actionName)
ot::ContextMenu::setContextMenuName
void setContextMenuName(const std::string &_name)
Definition
ContextMenu.h:28
ot::MenuCfg
Definition
MenuCfg.h:17
ot
Definition
Connector.h:8
Libraries
OTWidgets
include
OTWidgets
ContextMenu.h
Generated by
1.10.0