2019-01-01 11:15:16 +01:00
|
|
|
|
#include "MenuAction.h"
|
2019-01-01 08:26:20 +01:00
|
|
|
|
|
2019-01-01 11:15:16 +01:00
|
|
|
|
MenuAction::MenuAction(QString text, Func func)
|
|
|
|
|
|
: m_text(std::move(text))
|
|
|
|
|
|
, m_func(std::move(func))
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
const QIcon& MenuAction::icon() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_icon;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const MenuLocation& MenuAction::menuLocation() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_menuLocation;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuAction::setIcon(QIcon icon)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_icon = std::move(icon);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuAction::setMenuLocation(MenuLocation menu_location)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_menuLocation = std::move(menu_location);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-01-05 19:58:23 +01:00
|
|
|
|
void MenuAction::setShortcut(QKeySequence shortcut)
|
2019-01-01 11:15:16 +01:00
|
|
|
|
{
|
2019-01-05 19:58:23 +01:00
|
|
|
|
m_shortcut = std::move(shortcut);
|
2019-01-01 11:15:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuAction::setText(QString text)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_text = std::move(text);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuAction::setToolTip(QString tooltip)
|
2019-01-01 08:26:20 +01:00
|
|
|
|
{
|
2019-01-01 11:15:16 +01:00
|
|
|
|
m_toolTip = std::move(tooltip);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-01-05 19:58:23 +01:00
|
|
|
|
const QKeySequence& MenuAction::shortcut() const
|
2019-01-01 11:15:16 +01:00
|
|
|
|
{
|
2019-01-05 19:58:23 +01:00
|
|
|
|
return m_shortcut;
|
2019-01-01 11:15:16 +01:00
|
|
|
|
}
|
2019-01-01 08:26:20 +01:00
|
|
|
|
|
2019-01-01 11:15:16 +01:00
|
|
|
|
const QString& MenuAction::text() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const QString& MenuAction::toolTip() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_toolTip;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuAction::perform(IPluginContentWidgetContext *context) const
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_func)
|
|
|
|
|
|
m_func(context);
|
2019-01-01 08:26:20 +01:00
|
|
|
|
}
|