pgLab/pglab/plugin_support/MenuPath.h
eelke a704332342 Work on plugin mechanism
Context actions have become normal actions in the pluginwidget so the widget knows abot them and
can easily do things like enable/disable.
2019-02-08 10:10:11 +01:00

47 lines
760 B
C++

#ifndef MENUPATH_H
#define MENUPATH_H
#include <QString>
#include <QVector>
#include <vector>
/// For a menu path we use a string very similar to a file path. Width however the addition of semicolons
/// for specifying groups. So the following path
///
/// /File:Save
///
/// Specifies the File menu and the group Save within that menu while
///
/// /File/Export
///
/// Would specify the export sub menu of the file menu
///
class MenuPath {
public:
MenuPath();
MenuPath(QString menu_path);
private:
class Elem {
public:
QStringRef menu;
QStringRef group;
explicit Elem(QStringRef s)
{
auto p = s.split(':');
menu = p[0];
if (p.size() > 1) {
group = p[1];
}
}
};
std::vector<Elem> m_elems;
};
#endif // MENUPATH_H