diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-21 23:21:52 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-21 23:21:52 (GMT) |
commit | 8b059a78b2632e31492fa25cfaae99b111a041a6 (patch) | |
tree | e30c11849ffc99ceee0c52a3951aa732db715ec0 /src/gui/text/qtextlayout.cpp | |
parent | 7f3d9a76e9d956d9e7e4398ac20785070e214958 (diff) | |
parent | c3eeb227360343ccb34365e384e085b358d81f21 (diff) | |
download | Qt-8b059a78b2632e31492fa25cfaae99b111a041a6.zip Qt-8b059a78b2632e31492fa25cfaae99b111a041a6.tar.gz Qt-8b059a78b2632e31492fa25cfaae99b111a041a6.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (26 commits)
Fix incorrect usage of _HB_OPEN_Free_Device() in CaretValue cleanup
Fix null HB_Device** dereference on exit in Harfbuzz GPOS code
Doc: Relicensed the documentation under the GNU FDL version 1.3.
doc: Added more DITA output to the XML generator
Designer: Prevent QButtonGroup from being added for Q3ButtonGroup.
Fix for a leak in the mac style.
Doc: Fixing bugs to style and script
doc: Added more DITA output to the XML generator
Make sure that <br/> is seen as a valid tag in Qt::mightBeRichText()
Fix compiler warnings in QtGui (text,painting).
Allow Unix to generate unique UUIDs if /dev/urandom exists.
Allow GNU Free Documentation license header.
Add missing license header.
Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to ab9a897b688e991a8405cf938dea9d6a2f1ac072
Fix example compile and runtime warnings, webkit examples not built.
qgl_cl_p.h is no longer existent
Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to 5699175f55acbdfa4ac95ab6c727ebd4a201f3a2
Doc: Fixed documentation errors.
doc: Added more DITA output to the XML generator
doc: Fixed type of Package::name
...
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-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 fec9ecc..d6535ea 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 */ |