slint::StyledText Struct
struct StyledText;C++
#include <slint.h>C++
Styled text that has been parsed and separated into paragraphs.
Use StyledText::from_markdown() to parse a markdown string, or StyledText::from_plain_text() to wrap plain text without formatting.
Assign the result to a styled-text property in a Slint component to display it.
Public Functions
Section titled “Public Functions” StyledText
Section titled “ StyledText”slint::StyledText::StyledText()
Creates a default (empty) styled text.
~StyledText
Section titled “ ~StyledText”slint::StyledText::~StyledText()
Destroys this StyledText.
StyledText
Section titled “ StyledText”slint::StyledText::StyledText(const StyledText &other)
Creates a new StyledText from other.
operator=
Section titled “ operator=”StyledText & slint::StyledText::operator=(const StyledText &other)
Assigns other to this styled text and returns a reference to this styled text.
operator=
Section titled “ operator=”StyledText & slint::StyledText::operator=(StyledText &&other)
Move-assigns other to this StyledText instance.
Friends
Section titled “Friends” operator==
Section titled “ operator==”bool operator==(const StyledText &a, const StyledText &b)
Returns true if a is equal to b; otherwise returns false.
Public Static Functions
Section titled “Public Static Functions” from_plain_text
Section titled “ from_plain_text”static StyledText slint::StyledText::from_plain_text(std::string_view text)
Creates styled text from plain text without applying markdown parsing.
from_markdown
Section titled “ from_markdown”static std::optional< StyledText > slint::StyledText::from_markdown(std::string_view markdown)
Parses markdown into styled text.
Returns std::nullopt if the markdown contains unsupported syntax.
© 2026 SixtyFPS GmbH