summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_richtext.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/code/doc_src_richtext.qdoc')
-rw-r--r--doc/src/snippets/code/doc_src_richtext.qdoc50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/src/snippets/code/doc_src_richtext.qdoc b/doc/src/snippets/code/doc_src_richtext.qdoc
new file mode 100644
index 0000000..d6f54c2
--- /dev/null
+++ b/doc/src/snippets/code/doc_src_richtext.qdoc
@@ -0,0 +1,50 @@
+//! [0]
+QTextDocument *newDocument = new QTextDocument;
+//! [0]
+
+
+//! [1]
+QTextEdit *editor = new QTextEdit;
+QTextDocument *editorDocument = editor->document();
+//! [1]
+
+
+//! [2]
+QTextEdit *editor = new QTextEdit(parent);
+editor->setHtml(aStringContainingHTMLtext);
+editor->show();
+//! [2]
+
+
+//! [3]
+QTextDocument *document = editor->document();
+//! [3]
+
+
+//! [4]
+QTextCursor cursor = editor->textCursor();
+//! [4]
+
+
+//! [5]
+editor->setTextCursor(cursor);
+//! [5]
+
+
+//! [6]
+textEdit.show();
+
+textCursor.beginEditBlock();
+
+for (int i = 0; i < 1000; ++i) {
+ textCursor.insertBlock();
+ textCursor.insertText(paragraphText.at(i));
+}
+
+textCursor.endEditBlock();
+//! [6]
+
+
+//! [7]
+<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
+//! [7]