Bunch of renames to reduce confusion.
This commit is contained in:
parent
cbb2f897aa
commit
be2ffd7ef9
15 changed files with 184 additions and 184 deletions
50
pglab/plugin_support/StaticAction.h
Normal file
50
pglab/plugin_support/StaticAction.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#ifndef MENUACTION_H
|
||||
#define MENUACTION_H
|
||||
|
||||
#include "MenuLocation.h"
|
||||
#include "ToolbarLocation.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QKeySequence>
|
||||
#include <QString>
|
||||
#include <functional>
|
||||
|
||||
class QAction;
|
||||
class IPluginContentWidgetContext;
|
||||
|
||||
/** An action for in a menu or toolbar that does not pertain to a specific
|
||||
* widget. It often will create a widget for instance a New or Open action.
|
||||
* It does need a context.
|
||||
*
|
||||
*/
|
||||
class StaticAction {
|
||||
public:
|
||||
using Func = std::function<void(IPluginContentWidgetContext *context)>;
|
||||
|
||||
StaticAction(QString text, Func func);
|
||||
|
||||
const QIcon& icon() const;
|
||||
const MenuLocation& menuLocation() const;
|
||||
void setIcon(QIcon icon);
|
||||
void setMenuLocation(MenuLocation menu_location);
|
||||
void setToolbarLocation(ToolbarLocation toolbar_location);
|
||||
void setShortcut(QKeySequence shortcut);
|
||||
void setText(QString text);
|
||||
void setToolTip(QString tooltip);
|
||||
const QKeySequence& shortcut() const;
|
||||
const QString& text() const;
|
||||
const QString& toolTip() const;
|
||||
|
||||
void perform(IPluginContentWidgetContext *context) const;
|
||||
private:
|
||||
QString m_text;
|
||||
QString m_toolTip;
|
||||
QIcon m_icon;
|
||||
QKeySequence m_shortcut;
|
||||
MenuLocation m_menuLocation;
|
||||
ToolbarLocation m_toolbarLocation;
|
||||
|
||||
Func m_func;
|
||||
};
|
||||
|
||||
#endif // MENUACTION_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue