diff options
author | Robin Burchell <robin.burchell@collabora.co.uk> | 2010-06-15 22:21:10 (GMT) |
---|---|---|
committer | Robin Burchell <robin.burchell@collabora.co.uk> | 2010-06-15 22:33:05 (GMT) |
commit | a2ee2eb3e9991ae42ebe56898e25e742c2762ff2 (patch) | |
tree | d76ce6608bbadad0507b040249cff220f2c321fc /src/gui | |
parent | 1c20abaaeef1ab448526e5821db06350537c1333 (diff) | |
download | Qt-a2ee2eb3e9991ae42ebe56898e25e742c2762ff2.zip Qt-a2ee2eb3e9991ae42ebe56898e25e742c2762ff2.tar.gz Qt-a2ee2eb3e9991ae42ebe56898e25e742c2762ff2.tar.bz2 |
Documentation changes to QTextLayout.
- Improves quality of English in some cases
- Removes some redundant redundancy
Generally makes it more pleasant to read, IMHO.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index ddf9411..dbfe23e 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -282,12 +282,11 @@ Qt::LayoutDirection QTextInlineObject::textDirection() const \class QTextLayout \reentrant - \brief The QTextLayout class is used to lay out and paint a single - paragraph of text. + \brief The QTextLayout class is used to lay out and render text. \ingroup richtext-processing - It offers most features expected from a modern text layout + It offers many features expected from a modern text layout engine, including Unicode compliant rendering, line breaking and handling of cursor positioning. It can also produce and render device independent layout, something that is important for WYSIWYG @@ -297,29 +296,33 @@ Qt::LayoutDirection QTextInlineObject::textDirection() const implement your own text rendering for some specialized widget, you probably won't need to use it directly. - QTextLayout can currently deal with plain text and rich text - paragraphs that are part of a QTextDocument. + QTextLayout can be used with both plain and rich text. - QTextLayout can be used to create a sequence of QTextLine's with - given widths and can position them independently on the screen. - Once the layout is done, these lines can be drawn on a paint - device. + QTextLayout can be used to create a sequence of QTextLine + instances with given widths and can position them independently + on the screen. Once the layout is done, these lines can be drawn + on a paint device. - Here's some code snippet that presents the layout phase: + The text to be laid out can be provided in the constructor or set with + setText(). + + The layout can be seen as a sequence of QTextLine objects; use createLine() + to create a QTextLine instance, and lineAt() or lineForTextPosition() to retrieve + created lines. + + Here is a code snippet that demonstrates the layout phase: \snippet doc/src/snippets/code/src_gui_text_qtextlayout.cpp 0 - The text can be drawn by calling the layout's draw() function: + The text can then be rendered by calling the layout's draw() function: \snippet doc/src/snippets/code/src_gui_text_qtextlayout.cpp 1 - The text layout's text is set in the constructor or with - setText(). The layout can be seen as a sequence of QTextLine - objects; use lineAt() or lineForTextPosition() to get a QTextLine, - createLine() to create one. For a given position in the text you - can find a valid cursor position with isValidCursorPosition(), - nextCursorPosition(), and previousCursorPosition(). The layout - itself can be positioned with setPosition(); it has a - boundingRect(), and a minimumWidth() and a maximumWidth(). A text - layout can be drawn on a painter device using draw(). + For a given position in the text you can find a valid cursor position with + isValidCursorPosition(), nextCursorPosition(), and previousCursorPosition(). + + The QTextLayout itself can be positioned with setPosition(); it has a + boundingRect(), and a minimumWidth() and a maximumWidth(). + + \sa QStaticText */ |