ZStyledTextLine¶
ZStyledTextLine is a helper class to implement display of text with markup.
-
class Tui::ZStyledTextLine¶
This class is copyable and movable. It does not define comparison operators.
A helper class to implement display of text with markup.
-
QString markup() const¶
Using these functions the text content can be set using markup or retrieved.
When the content was most recently set using setText the returned markup is empty.
-
QString text() const¶
Using these functions the plain text content can be get or set.
When the content was most recently set using setMarkup the returned text is empty.
-
void setBaseStyle(ZTextStyle newBaseStyle)¶
Set the base style for display.
The base style is used for text where no other style applies.
-
void setMnemonicStyle(ZTextStyle newBaseStyle, ZTextStyle newMnemonicStyle)¶
Set the mnemonic style for display.
The mnemonic style is used for text enclosed in a
m
element.
-
QString mnemonic() const¶
Returns the code point enclosed in a
m
element in the markup.If more than one code point is in the
m
element or in multiplem
elements the empty string is returned.
-
bool hasParsingError() const¶
Returns true, iff there was a problem parsing the markup.
-
int width(const ZTextMetrics &metrics) const¶
Return the width of the text to display.
-
QString markup() const¶