RichString Class

This class add support for the rich text string of the cell. More...

Header: #include <RichString>

Public Functions

RichString(const QString text)
RichString(const RichString & other)
void addFragment(const QString & text, const Format & format)
int fragmentCount() const
Format fragmentFormat(int index) const
QString fragmentText(int index) const
bool isEmtpy() const
bool isNull() const
bool isRichString() const
void setHtml(const QString & text)
QString toHtml() const
QString toPlainString() const
operator QVariant() const
RichString & operator=(const RichString & other)

Detailed Description

This class add support for the rich text string of the cell.

Member Function Documentation


Constructs a null string.

RichString::RichString(const QString text)

Constructs a plain string with the given text.

RichString::RichString(const RichString & other)

Constructs a copy of other.


Destructs the string.

void RichString::addFragment(const QString & text, const Format & format)

Appends a fragment with the given text and format.

int RichString::fragmentCount() const

Returns fragment count.

Format RichString::fragmentFormat(int index) const

Returns fragment format at the position index.

QString RichString::fragmentText(int index) const

Returns fragment text at the position index.

bool RichString::isEmtpy() const

Returns true is this is an empty string.

bool RichString::isNull() const

Returns true is this is an Null string.

bool RichString::isRichString() const

Returns true if this is rich text string.

void RichString::setHtml(const QString & text)

Replaces the entire contents of the document with the given HTML-formatted text in the text string

QString RichString::toHtml() const

Converts to html string

QString RichString::toPlainString() const

Converts to plain text string.

RichString::operator QVariant() const

Returns the rich string as a QVariant

RichString & RichString::operator=(const RichString & other)

Assigns other to this string and returns a reference to this string