上下文类

Core::Context

The Context 类实现了一系列上下文 ID。 更多...

头文件 #include <coreplugin/icontext.h>

公共类型

公共函数

上下文()
Context(Utils::Id c1)
Context(Utils::Id c1, Utils::Id c2)
Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)
voidadd(const Core::Context &c)
voidadd(Utils::Id c)
Utils::Idat(int i) const
Core::Context::const_iteratorbegin() const
boolcontains(Utils::Id c) const
Core::Context::const_iteratorend() const
intindexOf(Utils::Id c) const
boolisEmpty() const
voidprepend(Utils::Id c)
voidremoveAt(int i)
intsize() const

详细描述

上下文用于向 Core::ActionManager 注册动作,并且当创建提供上下文动作的 UI 元素时使用。

关于上下文使用概况,请参阅 动作管理器和命令

另请参阅 Core::IContextCore::ActionManager,以及 动作管理器和命令

成员类型文档

[别名] Context::const_iterator

The Context::const_iterator 提供了 Context 的 STL 风格常量迭代器。

成员函数文档

[constexpr noexcept] Context::Context()

创建一个代表全局上下文的上下文列表。

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

创建一个只有一个 ID 加工 的上下文列表。

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

创建一个包含 ID 加工加工 的上下文列表。

上下文::Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)

创建一个包含ID c1c2c3 的上下文列表。

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

将上下文列表 c 添加到该上下文列表的末尾。

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

将ID c 添加到上下文列表的末尾。

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

返回上下文列表中索引 i 处的ID。

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

返回一个指向上下文列表中第一个ID的STL风格的迭代器。

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

返回该上下文列表是否包含ID c

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

返回一个指向上下文列表中最后一个ID后面假想的项目(虚构项目)的STL风格的迭代器。

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

返回ID c 在上下文列表中的索引位置。如果没有匹配项,则返回-1。

bool Context::isEmpty() const

返回此上下文列表是否为空,因此默认构造。

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

将ID c 添加到上下文列表的开头。

void Context::removeAt(int i)

从上下文列表中删除索引 i 处的ID。

int Context::size() const

返回上下文列表中ID的数量。

©2024 Qt公司 Ltd. 本文档的贡献者是各自所有权的著作权人。提供的文档是根据自由软件基金会发布的GNU自由文档许可协议版本1.3的条款许可的。Qt及其标志是芬兰以及全球其他国家的Qt公司的商标。所有其他商标均为其各自所有者的财产。