En esta página

Core::Context Class

class Core::Context

La clase «Context» implementa una lista de identificadores de contexto. Más...

Header: #include <coreplugin/icontext.h>

Tipos públicos

Funciones públicas

Context()
Context(Utils::Id c1)
Context(Utils::Id c1, Utils::Id c2)
Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)
void add(Utils::Id c)
void add(const Core::Context &c)
Utils::Id at(int i) const
Core::Context::const_iterator begin() const
bool contains(Utils::Id c) const
Core::Context::const_iterator end() const
int indexOf(Utils::Id c) const
bool isEmpty() const
void prepend(Utils::Id c)
void removeAt(int i)
int size() const

Descripción detallada

Los contextos se utilizan para registrar acciones en Core::ActionManager y al crear elementos de la interfaz de usuario que proporcionan un contexto para las acciones.

Consulte «El gestor de acciones y los comandos » para obtener una visión general de cómo se utilizan los contextos.

Véanse también « Core::IContext », « Core::ActionManager » y «El gestor de acciones y los comandos».

Documentación sobre el tipo de miembro

[alias] Context::const_iterator

Context::const_iterator proporciona un iterador const al estilo de la STL para Context.

Documentación de las funciones miembro

[constexpr noexcept] Context::Context()

Crea una lista de contexto que representa el contexto global.

[explicit] Context::Context(Utils::Id c1)

Crea una lista de contexto con un único ID: c1.

Context::Context(Utils::Id c1, Utils::Id c2)

Crea una lista de contexto con los ID « c1 » y « c2 ».

Context::Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)

Crea una lista de contexto con los ID c1, c2 y c3.

void Context::add(Utils::Id c)

Añade el ID « c » al final de la lista de contexto.

void Context::add(const Core::Context &c)

Añade la lista de contexto c al final de esta lista de contexto.

Utils::Id Context::at(int i) const

Devuelve el ID correspondiente al índice « i » de la lista de contexto.

Core::Context::const_iterator Context::begin() const

Devuelve un iterador de tipo STL que apunta al primer ID de la lista de contexto.

bool Context::contains(Utils::Id c) const

Devuelve si esta lista de contexto contiene el ID « c ».

Core::Context::const_iterator Context::end() const

Devuelve un iterador al estilo STL que apunta al elemento imaginario situado después del último ID de la lista de contexto.

int Context::indexOf(Utils::Id c) const

Devuelve la posición en la lista de contexto del ID « c ». Devuelve -1 si no se ha encontrado ningún elemento que coincida.

bool Context::isEmpty() const

Devuelve si esta lista de contexto está vacía y, por lo tanto, se ha creado con los valores por defecto.

void Context::prepend(Utils::Id c)

Añade el ID « c » como primer elemento de la lista de contexto.

void Context::removeAt(int i)

Elimina el ID del índice « i » de la lista de contexto.

int Context::size() const

Devuelve el número de identificadores que hay en la lista de contexto.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.