|
KanoopGuiQt 1.3.0
Qt GUI utility library
|
|
Streaming HTML fragment builder. More...
#include <htmlbuilder.h>
Public Member Functions | |
| HtmlBuilder () | |
| Construct an empty builder. | |
| void | startParagraph (const QColor &color=QColor(), const QColor &backgroundColor=QColor()) |
| Append an opening <p> tag with optional foreground and background colors. | |
| void | endParagraph () |
| Append a closing </p> tag. | |
| void | startBold () |
| Append an opening <b> tag. | |
| void | endBold () |
| Append a closing </b> tag. | |
| void | startStrong () |
| Append an opening <strong> tag. | |
| void | endStrong () |
| Append a closing </strong> tag. | |
| void | appendText (const QString &text) |
| Append plain text to the output. | |
| QString | toString () const |
| Return the accumulated HTML string. | |
Streaming HTML fragment builder.
HtmlBuilder accumulates HTML into an internal string via a QTextStream. Call the open/close methods in order, then retrieve the result with toString().
Definition at line 24 of file htmlbuilder.h.
| void HtmlBuilder::appendText | ( | const QString & | text | ) |
Append plain text to the output.
| text | Text to append (not HTML-escaped) |
| void HtmlBuilder::startParagraph | ( | const QColor & | color = QColor(), |
| const QColor & | backgroundColor = QColor() |
||
| ) |
Append an opening <p> tag with optional foreground and background colors.
| color | Foreground text color (invalid QColor = none) |
| backgroundColor | Background color (invalid QColor = none) |
|
inline |
Return the accumulated HTML string.
Definition at line 60 of file htmlbuilder.h.