Add Ui::Text::Link(TextWithEntities, url/index).
This commit is contained in:
parent
c199a1722f
commit
7f1dd3c351
2 changed files with 14 additions and 2 deletions
|
|
@ -43,7 +43,15 @@ TextWithEntities Link(const QString &text, const QString &url) {
|
|||
}
|
||||
|
||||
TextWithEntities Link(const QString &text, int index) {
|
||||
return Link(text, QString("internal:index") + QChar(index));
|
||||
return Link(text, u"internal:index"_q + QChar(index));
|
||||
}
|
||||
|
||||
TextWithEntities Link(TextWithEntities text, const QString &url) {
|
||||
return Wrapped(std::move(text), EntityType::CustomUrl, url);
|
||||
}
|
||||
|
||||
TextWithEntities Link(TextWithEntities text, int index) {
|
||||
return Link(std::move(text), u"internal:index"_q + QChar(index));
|
||||
}
|
||||
|
||||
TextWithEntities PlainLink(const QString &text) {
|
||||
|
|
|
|||
|
|
@ -29,8 +29,12 @@ inline constexpr auto Upper = details::ToUpperType{};
|
|||
[[nodiscard]] TextWithEntities Italic(const QString &text);
|
||||
[[nodiscard]] TextWithEntities Link(
|
||||
const QString &text,
|
||||
const QString &url = "internal:action");
|
||||
const QString &url = u"internal:action"_q);
|
||||
[[nodiscard]] TextWithEntities Link(const QString &text, int index);
|
||||
[[nodiscard]] TextWithEntities Link(
|
||||
TextWithEntities text,
|
||||
const QString &url = u"internal:action"_q);
|
||||
[[nodiscard]] TextWithEntities Link(TextWithEntities text, int index);
|
||||
[[nodiscard]] TextWithEntities PlainLink(const QString &text);
|
||||
[[nodiscard]] TextWithEntities Wrapped(
|
||||
TextWithEntities text,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue