Context Class
class Core::ContextThe Context class implements a list of context IDs. More...
Header: | #include <coreplugin/icontext.h> |
Public Functions
Context() | |
Context(int c1) | |
Context(int c1, int c2) | |
Context(int c1, int c2, int c3) | |
void | add(const Core::Context &c) |
int | at(int) const |
int | begin() const |
int | end() const |
bool | isEmpty() const |
void | removeAt(int i) |
int | size() const |
Detailed Description
Contexts are used for registering actions with Core::ActionManager, and when creating UI elements that provide a context for actions.
See The Action Manager and Commands for an overview of how contexts are used.
See also Core::IContext, Core::ActionManager, and The Action Manager and Commands.
Member Function Documentation
[constexpr noexcept]
Context::Context()
Creates a context list that represents the global context.
[explicit]
Context::Context(int c1)
Creates a context list with a single ID c1.
Context::Context(int c1, int c2)
Creates a context list with IDs c1 and c2.
Context::Context(int c1, int c2, int c3)
Creates a context list with IDs c1, c2 and c3.
void Context::add(const Core::Context &c)
Adds the context list c at the end of this context list.
int Context::at(int) const
Returns the ID at index i in the context list.
int Context::begin() const
Returns an STL-style iterator pointing to the first ID in the context list.
int Context::end() const
Returns an STL-style iterator pointing to the imaginary item after the last ID in the context list.
bool Context::isEmpty() const
Returns whether this context list is empty and therefore default constructed.
void Context::removeAt(int i)
Removes the ID at index i from the context list.
int Context::size() const
Returns the number of IDs in the context list.