|
KanoopGuiQt 1.3.0
Qt GUI utility library
|
|
QPlainTextEdit subclass with HTML-formatted and color-styled append helpers. More...
#include <plaintextedit.h>
Inheritance diagram for PlainTextEdit:
Collaboration diagram for PlainTextEdit:Public Types | |
| enum | TextFlag { NoTextFlags = 0x0000 , BoldText = 0x0001 , StrongText = 0x0002 } |
| Flags controlling text formatting for appendFormattedText(). More... | |
Public Member Functions | |
| PlainTextEdit (QWidget *parent=nullptr) | |
| Construct with an optional parent. | |
| PlainTextEdit (const QString &text, QWidget *parent=nullptr) | |
| Construct with initial text content. | |
| void | appendText (const QString &text, const QColor &foregroundColor=QColor(), const QColor &backgroundColor=QColor()) |
| Append a line of text with optional per-call colors. | |
| void | appendFormattedText (const QString &text, TextFlags flags, const QColor &foregroundColor=QColor(), const QColor &backgroundColor=QColor()) |
| Append a formatted line of text with flags and optional colors. | |
QPlainTextEdit subclass with HTML-formatted and color-styled append helpers.
PlainTextEdit adds appendText() for appending plain text with optional per-call foreground and background colors, and appendFormattedText() which additionally accepts TextFlags for bold/strong formatting.
Definition at line 14 of file plaintextedit.h.
Flags controlling text formatting for appendFormattedText().
| Enumerator | |
|---|---|
| NoTextFlags | No formatting. |
| BoldText | Render text in bold. |
| StrongText | Render text wrapped in <strong>. |
Definition at line 36 of file plaintextedit.h.
|
inlineexplicit |
Construct with an optional parent.
| parent | Optional QWidget parent |
Definition at line 22 of file plaintextedit.h.
|
inlineexplicit |
Construct with initial text content.
| text | Initial plain text |
| parent | Optional QWidget parent |
Definition at line 30 of file plaintextedit.h.
| void PlainTextEdit::appendFormattedText | ( | const QString & | text, |
| TextFlags | flags, | ||
| const QColor & | foregroundColor = QColor(), |
||
| const QColor & | backgroundColor = QColor() |
||
| ) |
Append a formatted line of text with flags and optional colors.
| text | Text to append |
| flags | Combination of TextFlag values |
| foregroundColor | Text color (invalid QColor = default) |
| backgroundColor | Background color (invalid QColor = default) |
| void PlainTextEdit::appendText | ( | const QString & | text, |
| const QColor & | foregroundColor = QColor(), |
||
| const QColor & | backgroundColor = QColor() |
||
| ) |
Append a line of text with optional per-call colors.
| text | Text to append |
| foregroundColor | Text color (invalid QColor = default) |
| backgroundColor | Background color (invalid QColor = default) |