Yayin Story Studio logo Yayin Story Studio 项目文档
回到主页 用户手册

YSSCore::Editor::TabCompleterItem Class

class YSSCore::Editor::TabCompleterItem

代表TabCompleter中的一个补全项. 详情...

头文件: #include <TabCompleterItem>
自以下版本: YSS 0.13.0

公开类型

(自 YSS 0.13.0 引入) enum ItemType { Default, Value, Const, Enum, Function, …, UserDefined }

公开成员函数

(自 YSS 0.13.0 引入) TabCompleterItem()
(自 YSS 0.13.0 引入) TabCompleterItem(QString text, QString content, QString description = "", YSSCore::Editor::TabCompleterItem::ItemType type = ItemType::Default, bool alignment = true)
(自 YSS 0.13.0 引入) TabCompleterItem(const YSSCore::Editor::TabCompleterItem &other)
(自 YSS 0.13.0 引入) TabCompleterItem(YSSCore::Editor::TabCompleterItem &&other)
(自 YSS 0.13.0 引入) ~TabCompleterItem()
(自 YSS 0.13.0 引入) QString getContent() const
(自 YSS 0.13.0 引入) QString getDescription() const
(自 YSS 0.13.0 引入) QString getIconPath() const
(自 YSS 0.13.0 引入) QString getText() const
(自 YSS 0.13.0 引入) YSSCore::Editor::TabCompleterItem::ItemType getType() const
(自 YSS 0.13.0 引入) bool isAlignment() const
(自 YSS 0.13.0 引入) void setContent(const QString &content)
(自 YSS 0.13.0 引入) void setDescription(const QString &description)
(自 YSS 0.13.0 引入) void setIconPath(const QString &iconPath)
(自 YSS 0.13.0 引入) void setText(const QString &text)
(自 YSS 0.13.0 引入) void setType(YSSCore::Editor::TabCompleterItem::ItemType type, bool redirectIcon = true)
(自 YSS 0.13.0 引入) YSSCore::Editor::TabCompleterItem &operator=(YSSCore::Editor::TabCompleterItem &&other)
(自 YSS 0.13.0 引入) YSSCore::Editor::TabCompleterItem &operator=(const YSSCore::Editor::TabCompleterItem &other)

详细说明

这类是个数据类,代表一个补全项,包含了补全项的文本、描述、内容、类型等信息。

成员类型文档

[since YSS 0.13.0] enum TabCompleterItem::ItemType

ConstantValueDescription
YSSCore::Editor::TabCompleterItem::Default0默认类型,图标为默认图标。
YSSCore::Editor::TabCompleterItem::Value1代表一个值,图标为值图标。
YSSCore::Editor::TabCompleterItem::Const2代表一个常量,图标为常量图标。
YSSCore::Editor::TabCompleterItem::Enum3代表一个枚举,图标为枚举图标。
YSSCore::Editor::TabCompleterItem::Function4代表一个函数,图标为函数图标。
YSSCore::Editor::TabCompleterItem::Object5代表一个对象,图标为对象图标。
YSSCore::Editor::TabCompleterItem::Operator6代表一个操作符,图标为操作符图标。
YSSCore::Editor::TabCompleterItem::UserDefined1000代表一个用户自定义类型,图标需要用户自己设置。

这个enum 从 YSS 0.13.0 开始支持。

成员函数文档

[since YSS 0.13.0] TabCompleterItem::TabCompleterItem()

默认构造函数。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] TabCompleterItem::TabCompleterItem(QString text, QString content, QString description = "", YSSCore::Editor::TabCompleterItem::ItemType type = ItemType::Default, bool alignment = true)

构造函数,接受补全项的文本、内容、描述、类型和对齐方式。 text 补全项的文本,用于显示在补全列表里。 content 补全项的内容,通常是插入到编辑器中的文本。 description 补全项的描述,通常用于显示在补全列表中。 type 补全项的类型,用于区分不同类型的补全项。 alignment 是否对齐补全项,默认为true。

对齐是个特殊概念,意味着当TextEdit尝试使用content插入到编辑器中时,如果alignment为true,则会自动 从光标所在位置向前检查,查看content的内容中是否有一些内容已经存在,如果存在就忽略重复性内容, 只补全剩余部分。比如content是"System.out.println",当alignment为true时,如果光标前已经有"System.",则只会补全"out.println"。

为false时,则不进行对齐,直接插入content的全部内容。一般来说应该使用true。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] TabCompleterItem::TabCompleterItem(const YSSCore::Editor::TabCompleterItem &other)

other 另一个TabCompleterItem对象。

复制构造函数。

这个function 从 YSS 0.13.0 开始支持。

[noexcept, since YSS 0.13.0] TabCompleterItem::TabCompleterItem(YSSCore::Editor::TabCompleterItem &&other)

other 另一个TabCompleterItem对象。

移动构造函数。

这个function 从 YSS 0.13.0 开始支持。

[noexcept, since YSS 0.13.0] TabCompleterItem::~TabCompleterItem()

析构函数。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] QString TabCompleterItem::getContent() const

return 补全项的内容。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] QString TabCompleterItem::getDescription() const

return 补全项的描述。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] QString TabCompleterItem::getIconPath() const

return 补全项的图标路径。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] QString TabCompleterItem::getText() const

return 补全项的文本。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] YSSCore::Editor::TabCompleterItem::ItemType TabCompleterItem::getType() const

return 补全项的类型。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] bool TabCompleterItem::isAlignment() const

return 补全项是否对齐。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] void TabCompleterItem::setContent(const QString &content)

content 补全项的内容。

设置补全项的内容。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] void TabCompleterItem::setDescription(const QString &description)

description 补全项的描述。

设置补全项的描述。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] void TabCompleterItem::setIconPath(const QString &iconPath)

iconPath 补全项的图标路径。

设置补全项的图标路径。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] void TabCompleterItem::setText(const QString &text)

text 补全项的文本。

设置补全项的文本。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] void TabCompleterItem::setType(YSSCore::Editor::TabCompleterItem::ItemType type, bool redirectIcon = true)

type 补全项的类型。 redirectIcon 是否根据类型自动设置图标路径,默认为true。

设置补全项的类型。

这个function 从 YSS 0.13.0 开始支持。

[noexcept, since YSS 0.13.0] YSSCore::Editor::TabCompleterItem &TabCompleterItem::operator=(YSSCore::Editor::TabCompleterItem &&other)

other 另一个TabCompleterItem对象。

移动赋值运算符。

这个function 从 YSS 0.13.0 开始支持。

[since YSS 0.13.0] YSSCore::Editor::TabCompleterItem &TabCompleterItem::operator=(const YSSCore::Editor::TabCompleterItem &other)

other 另一个TabCompleterItem对象。

复制赋值运算符。

这个function 从 YSS 0.13.0 开始支持。