libXpertMassCore and libXpertMassGui Developer Documentation
  • libXpertMassGui
  • ActionId
  • MsXpS::libXpertMassGui::ActionManager::ActionId Struct

    struct MsXpS::libXpertMassGui::ActionManager::ActionId

    The ActionId struct encapsulates the details about a GUI action. More...

    Public Functions

    ActionId()
    ActionId(const QString &the_context, const QString &the_category, const QString &the_unit, const QString &the_label)
    ActionId(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)
    void initialize(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)
    void initialize(const QString &action_id_text)
    void initialize(const QString &the_context, const QString &the_category, const QString &the_unit, const QString &the_label)
    bool isValid() const
    QString toString() const
    QStringList toStringList() const
    bool operator<(const MsXpS::libXpertMassGui::ActionManager::ActionId &other) const
    void operator=(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)
    bool operator==(const MsXpS::libXpertMassGui::ActionManager::ActionId &other) const

    Public Variables

    QString category
    QString context
    QString label
    QString unit

    Static Public Members

    MsXpS::libXpertMassGui::ActionManager::ActionId fromString(const QString &text)

    Detailed Description

    The ActionId that identifies the action is related to QAction instances in the ActionManager's m_actions member datum.

    Member Function Documentation

    ActionId::ActionId()

    Constructs an emtpy ActionId instance.

    ActionId::ActionId(const QString &the_context, const QString &the_category, const QString &the_unit, const QString &the_label)

    Constructs a fully qualified ActionId instance.

    ActionId::ActionId(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)

    Constructs an ActionId instance using other as a template.

    [static] MsXpS::libXpertMassGui::ActionManager::ActionId ActionId::fromString(const QString &text)

    Creates an ActionId instance by parsing text and returns it.

    text should have the strings formatted like this:

    context + "|" + category + "|" + unit + "|" + label

    void ActionId::initialize(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)

    Initializes this ActionId using other as a template.

    void ActionId::initialize(const QString &action_id_text)

    Initializes this ActionId using action_id_text as a template.

    void ActionId::initialize(const QString &the_context, const QString &the_category, const QString &the_unit, const QString &the_label)

    Initializes this ActionId instance.

    bool ActionId::isValid() const

    Returns true if all the members are non-empty, false otherwise.

    QString ActionId::toString() const

    Crafts a string describing this ActionId instance and returns it.

    The string is created as a '|'-concatenated string like this:

    context + "|" + category + "|" + unit + "|" + label

    QStringList ActionId::toStringList() const

    Crafts a QStringList describing this ActionId instance and returns it.

    The string list contains all the members in the followng order:

    context, category, unit, label

    bool ActionId::operator<(const MsXpS::libXpertMassGui::ActionManager::ActionId &other) const

    Returns true if any one of the members of the ActionId instances are different.

    The four members are compared pairwise in other and in this instance and as soon as one pair differs, true is returned if this instance's member is lexicographically smaller than the other's instance member. If the tested member of the two instances are identical, the other members are tested in the same manner. If, at the end the two instances were found identical, false is returned because this instance is thus not less than other.

    void ActionId::operator=(const MsXpS::libXpertMassGui::ActionManager::ActionId &other)

    Assigns other to this ActionId instance.

    bool ActionId::operator==(const MsXpS::libXpertMassGui::ActionManager::ActionId &other) const

    Returns true if all the members of this instance and other are identical, false otherwise.

    Member Variable Documentation

    QString ActionId::category

    This token describes the category of the action, like "File" or "Edit".

    QString ActionId::context

    This token describes the situation in which the action might be triggered. For example, context might be "ProgramWindow" or "DecimalPlacesOptionsDlg".

    QString ActionId::label

    This string describes the action in full for the user, like "Open mass spectrometry file full in memory".

    QString ActionId::unit

    This token describes the action itself, like "Open" or "Copy".