# QTextEdit four operations + [參考網站](http://web.mit.edu/~firebird/arch/sun4x_59/doc/html/qtextedit.html) |Mode |Command |Notes | |---|---|---| |Plain Text Editor|setTextFormat(PlainText)|Set text with setText(); text() returns plain text. Text attributes (e.g. colors) can be set, but plain text is always returned.| |Rich Text Editor|setTextFormat(RichText)|Set text with setText(); text() returns rich text. Rich text editing is fairly limited. You can't set margins or insert images for example (although you can read and correctly display files that have margins set and that include images). This mode is mostly useful for editing small amounts of rich text.| |Text Viewer|setReadOnly(TRUE)|Set text with setText() or append() (which has no undo history so is faster and uses less memory); text() returns plain or rich text depending on the textFormat(). This mode can correctly display a large subset of HTML tags.| |Log Viewer|setTextFormat(LogText)|Append text using append(). The widget is set to be read only and rich text support is disabled although a few HTML tags (for color, bold, italic and underline) may be used. (See LogText mode for details.)| --- + **image 可以放在 QTextEdit 裡面,但不能在 QTextEdit 調整大小,要調整就用 Label**