diff options
Diffstat (limited to 'examples/widgets/richtext')
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.png | bin | 0 -> 43420 bytes | |||
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.rst | 8 | ||||
-rw-r--r-- | examples/widgets/richtext/textedit/doc/textedit.png | bin | 0 -> 120703 bytes | |||
-rw-r--r-- | examples/widgets/richtext/textedit/doc/textedit.rst | 8 | ||||
-rw-r--r-- | examples/widgets/richtext/textobject/doc/textobject.png | bin | 0 -> 5844 bytes | |||
-rw-r--r-- | examples/widgets/richtext/textobject/doc/textobject.rst | 31 |
6 files changed, 47 insertions, 0 deletions
diff --git a/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.png b/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.png Binary files differnew file mode 100644 index 000000000..37b13b128 --- /dev/null +++ b/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.png diff --git a/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.rst b/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.rst new file mode 100644 index 000000000..d088ffd13 --- /dev/null +++ b/examples/widgets/richtext/syntaxhighlighter/doc/syntaxhighlighter.rst @@ -0,0 +1,8 @@ +Syntax Highlighter Example +========================== + +The Syntax Highlighter example shows how to perform simple syntax highlighting. + +.. image:: syntaxhighlighter.png + :width: 400 + :alt: Syntax Highlighter Screenshot diff --git a/examples/widgets/richtext/textedit/doc/textedit.png b/examples/widgets/richtext/textedit/doc/textedit.png Binary files differnew file mode 100644 index 000000000..e0e681f35 --- /dev/null +++ b/examples/widgets/richtext/textedit/doc/textedit.png diff --git a/examples/widgets/richtext/textedit/doc/textedit.rst b/examples/widgets/richtext/textedit/doc/textedit.rst new file mode 100644 index 000000000..2c8bc3232 --- /dev/null +++ b/examples/widgets/richtext/textedit/doc/textedit.rst @@ -0,0 +1,8 @@ +TextEdit Example +================ + +The Text Edit example shows Qt's rich text editing facilities in action. + +.. image:: textedit.png + :width: 400 + :alt: TextEdit Screenshot diff --git a/examples/widgets/richtext/textobject/doc/textobject.png b/examples/widgets/richtext/textobject/doc/textobject.png Binary files differnew file mode 100644 index 000000000..ebd2e6f7b --- /dev/null +++ b/examples/widgets/richtext/textobject/doc/textobject.png diff --git a/examples/widgets/richtext/textobject/doc/textobject.rst b/examples/widgets/richtext/textobject/doc/textobject.rst new file mode 100644 index 000000000..d5a1e253a --- /dev/null +++ b/examples/widgets/richtext/textobject/doc/textobject.rst @@ -0,0 +1,31 @@ +TextObject Example +================== + +A QTextDocument consists of a hierarchy of elements, such as text blocks and +frames. A text object describes the structure or format of one or more of these +elements. For instance, images imported from HTML are implemented using text +objects. Text objects are used by the document's layout to lay out and render +(paint) the document. Each object knows how to paint the elements they govern, +and calculates their size. + +To be able to insert an SVG image into a text document, we create a text +object, and implement painting for that object. This object can then be set on +a QTextCharFormat. We also register the text object with the layout of the +document, enabling it to draw QTextCharFormats governed by our text object. We +can summarize the procedure with the following steps: + + * Implement the text object. + * Register the text object with the layout of the text document. + * Set the text object on a QTextCharFormat. + * Insert a QChar::ObjectReplacementCharacter with that text char format into + the document. + +The example consists of the following classes: + + * SvgTextObject implements the text object. + * Window shows a QTextEdit into which SVG images can be inserted. + + +.. image:: textobject.png + :width: 400 + :alt: TextObject Screenshot |