Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QString QTextDocument::toHtml ( const QByteArray encoding = QByteArray()  )  const

Returns a string containing an HTML representation of the document.

The encoding parameter specifies the value for the charset attribute in the html header. For example if 'utf-8' is specified then the beginning of the generated html will look like this: doc/src/snippets/code/src_gui_text_qtextdocument.cpp 1

If no encoding is specified then no such meta information is generated.

If you later on convert the returned html string into a byte array for transmission over a network or when saving to disk you should specify the encoding you're going to use for the conversion to a byte array here.

See also:
{Supported HTML Subset}

Definition at line 2786 of file qtextdocument.cpp.

    return QTextHtmlExporter(this).toHtml(encoding);

Generated by  Doxygen 1.6.0   Back to index