summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/text/qtextlayout.cpp43
2 files changed, 24 insertions, 21 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index c9176d1..2de3638 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3865,7 +3865,7 @@ qreal QGraphicsItem::scale() const
The scale is combined with the item's rotation(), transform() and
transformations() to map the item's coordinate system to the parent item.
- \sa scale(), setTransformOriginPoint(), {Transformations}
+ \sa scale(), setTransformOriginPoint(), {Transformations Example}
*/
void QGraphicsItem::setScale(qreal factor)
{
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
*/