Core::Context Class
class Core::ContextKlasa Context implementuje listę identyfikatorów kontekstów. Więcej...
| Header: | #include <coreplugin/icontext.h> |
Typy publiczne
Funkcje publiczne
| 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 |
Szczegółowy opis
Konteksty służą do rejestrowania akcji w menedżerze akcji ( Core::ActionManager) oraz podczas tworzenia elementów interfejsu użytkownika, które zapewniają kontekst dla akcji.
Przegląd sposobu wykorzystania kontekstów można znaleźć w sekcji Menedżer akcji i polecenia.
Zobacz także: Core::IContext, Core::ActionManager oraz „Menedżer akcji i polecenia”.
Dokumentacja typu członkowskiego
[alias] Context::const_iterator
Klasa Context::const_iterator udostępnia iterator typu const w stylu STL dla obiektu Context.
Dokumentacja funkcji składowych
[constexpr noexcept] Context::Context()
Tworzy listę kontekstową reprezentującą kontekst globalny.
[explicit] Context::Context(Utils::Id c1)
Tworzy listę kontekstową o jednym identyfikatorze c1.
Context::Context(Utils::Id c1, Utils::Id c2)
Tworzy listę kontekstową zawierającą identyfikatory c1 oraz c2.
Context::Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)
Tworzy listę kontekstową zawierającą identyfikatory: c1, c2 oraz c3.
void Context::add(Utils::Id c)
Dodaje identyfikator „ c ” na końcu listy kontekstowej.
void Context::add(const Core::Context &c)
Dodaje listę kontekstową c na końcu tej listy kontekstowej.
Utils::Id Context::at(int i) const
Zwraca identyfikator znajdujący się pod indeksem „ i ” na liście kontekstowej.
Core::Context::const_iterator Context::begin() const
Zwraca iterator w stylu STL wskazujący na pierwszy identyfikator na liście kontekstowej.
bool Context::contains(Utils::Id c) const
Zwraca wartość wskazującą, czy ta lista kontekstowa zawiera identyfikator c.
Core::Context::const_iterator Context::end() const
Zwraca iterator w stylu STL, wskazujący na fikcyjny element znajdujący się po ostatnim identyfikatorze na liście kontekstowej.
int Context::indexOf(Utils::Id c) const
Zwraca pozycję indeksową elementu o identyfikatorze c na liście kontekstowej. Zwraca -1, jeśli nie znaleziono żadnego pasującego elementu.
bool Context::isEmpty() const
Zwraca wartość wskazującą, czy ta lista kontekstowa jest pusta, a zatem została utworzona domyślnie.
void Context::prepend(Utils::Id c)
Dodaje identyfikator „ c ” jako pierwszą pozycję na liście kontekstowej.
void Context::removeAt(int i)
Usuwa identyfikator znajdujący się pod indeksem i z listy kontekstowej.
int Context::size() const
Zwraca liczbę identyfikatorów znajdujących się na liście kontekstowej.
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.